Skip to content

Quiet optimized dependency sourcemap warnings#4646

Draft
lukemelia wants to merge 2 commits intomainfrom
cs-11019-quiet-ember-cli-warnings
Draft

Quiet optimized dependency sourcemap warnings#4646
lukemelia wants to merge 2 commits intomainfrom
cs-11019-quiet-ember-cli-warnings

Conversation

@lukemelia
Copy link
Copy Markdown
Contributor

Summary

  • Adds a serve-only Vite middleware that pads optimized dependency sourcemaps before Vite transforms the matching optimized dep JavaScript file.
  • Prevents Vite from hydrating missing sourcesContent entries from pnpm package paths outside packages/host/node_modules/.vite, which removes the repeated "Sourcemap for ... points to a source file outside its package" warnings.

Validation

  • Reproduced the warning with pnpm start in packages/host before the change.
  • Verified optimized dependency requests no longer print the sourcemap warning after the change.
  • Confirmed affected maps are padded so sourcesContent length matches sources length.
  • Ran mise exec -- pnpm lint in packages/host.
  • Ran mise exec -- pnpm build in packages/host.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Preview deployments

Host Test Results

    1 files  ±    0      1 suites  ±0   1h 44m 12s ⏱️ - 3h 29m 39s
2 565 tests +    3  2 550 ✅ +   10  15 💤 ± 0  0 ❌ ± 0 
2 584 runs   - 5 159  2 569 ✅  - 5 101  15 💤  - 30  0 ❌  - 14 

Results for commit 0bf39eb. ± Comparison against earlier commit dffbbca.

Realm Server Test Results

    1 files  ± 0      1 suites  ±0   18m 29s ⏱️ +11s
1 239 tests +21  1 239 ✅ +21  0 💤 ±0  0 ❌ ±0 
1 317 runs  +27  1 317 ✅ +27  0 💤 ±0  0 ❌ ±0 

Results for commit 0bf39eb. ± Comparison against earlier commit dffbbca.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a Vite dev-server middleware in packages/host to patch optimized dependency sourcemaps on the fly so Vite stops emitting repeated sourcemap warnings during pnpm start.

Changes:

  • Adds a serve-only Vite plugin that intercepts optimized dependency requests under node_modules/.vite/deps.
  • Reads matching .js.map files and pads missing sourcesContent entries before Vite continues serving the dependency.
  • Wires the new middleware into the host app’s Vite plugin list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/host/vite.config.mjs
Comment thread packages/host/vite.config.mjs Outdated
Address Copilot review on #4646:

- Skip the file read + JSON parse on every optimized-dep request after
  the first by tracking padded map paths in a Set.
- Read the real source file from disk for missing sourcesContent slots
  instead of writing empty strings. The Vite warning fires precisely
  because those paths escape the package boundary; reading them
  ourselves quiets the warning while preserving DevTools source-level
  debugging of vendor code. Falls back to an empty string if the read
  fails.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants