Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(optimizer): workaround firefox's false warning for no sources source map #18665

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hi-ogawa
Copy link
Collaborator

@hi-ogawa hi-ogawa commented Nov 14, 2024

Description

I reported the issue to esbuild evanw/esbuild#3945, but Vite side workaround seems reasonably simple, so I made a PR here. Note that Rolldown doesn't create a source map for this case, so this won't be an issue with rolldown-based optimizer in the future.

How to verify

  • pnpm -C playground/optimize-deps dev --force
  • open a page on Firefox (I tested on 132.0)
  • open devtool debugger tab
  • on main, it shows "Source map error: No sources are declared in this source map." in devtool console
  • on this PR, there's no warning.

(there were already a warning from an existing test dependencies, but I added a probably simplest one to see it easily)

@hi-ogawa hi-ogawa marked this pull request as ready for review November 14, 2024 01:22
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Looks good to me with some small questions.

packages/vite/src/node/optimizer/index.ts Outdated Show resolved Hide resolved
packages/vite/src/node/optimizer/index.ts Outdated Show resolved Hide resolved
hi-ogawa and others added 2 commits November 15, 2024 08:31
Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: Bjorn Lu <[email protected]>
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.

Vite is seemingly creating empty/junk source maps when optimizing dependencies
2 participants