Skip to content

fix: ignore directive sourcemap error#369

Merged
ArnaudBarre merged 1 commit into
mainfrom
chore/ignore-directive-source-map-error
Sep 25, 2024
Merged

fix: ignore directive sourcemap error#369
ArnaudBarre merged 1 commit into
mainfrom
chore/ignore-directive-source-map-error

Conversation

@sapphi-red
Copy link
Copy Markdown
Member

Description

The upstream issue was not resolved for a while, so adding a workaround.

close vitejs/vite#15012

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link
Copy Markdown
Contributor

@hi-ogawa hi-ogawa 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!

@ArnaudBarre ArnaudBarre merged commit d88c581 into main Sep 25, 2024
@ArnaudBarre ArnaudBarre deleted the chore/ignore-directive-source-map-error branch September 25, 2024 08:06
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Sep 30, 2024
| datasource | package              | from  | to    |
| ---------- | -------------------- | ----- | ----- |
| npm        | @vitejs/plugin-react | 4.3.1 | 4.3.2 |


## [v4.3.2](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#432-2024-09-29)

Ignore directive sourcemap error [#369](vitejs/vite-plugin-react#369)
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Sep 30, 2024
| datasource | package              | from  | to    |
| ---------- | -------------------- | ----- | ----- |
| npm        | @vitejs/plugin-react | 4.3.1 | 4.3.2 |


## [v4.3.2](https://github.com/vitejs/vite-plugin-react/blob/HEAD/packages/plugin-react/CHANGELOG.md#432-2024-09-29)

Ignore directive sourcemap error [#369](vitejs/vite-plugin-react#369)
@csantos1113
Copy link
Copy Markdown

I'm having a hard time understanding how a change on this plugin actually "fixed" an issue in vite itself 🤔 vitejs/vite#15012

I'd appreciate if someone could explain it to me 🙏

@hi-ogawa
Copy link
Copy Markdown
Contributor

@csantos1113 This has been a known workaround on user land (such as the comment suggested in vitejs/vite#15012 (comment)), so this PR only made it applied automatically for react plugin users. It doesn't "fix" the underlying issue, but practically it solved the user-facing issue for Vite users.

@csantos1113
Copy link
Copy Markdown

@hi-ogawa thanks for the quick response!

Yes, that known workaround is what I had on my codebase as well.

But the thing that intrigued me the most is how a vitest plugin solves the warning experience when building w/ vite? Is it being used under the hood somehow?

@hi-ogawa
Copy link
Copy Markdown
Contributor

I'm not sure what you mean by "vitest plugin" 🤔 This fix is added to vite react plugin. Also the warning is only coming from "vite build" (which involves rollup) and Vitest doesn't use vite build feature, so I don't think any similar warnings would've appeared for Vitest users.

@csantos1113
Copy link
Copy Markdown

🙈 well... that would explain why I was having a hard time understanding the solution: I'm really sorry, I saw "vitejs" on the URLs and was always thinking on "vitest" instead.

All good, and thanks for taking the time for bearing with me on my confusion!

@jbojcic1
Copy link
Copy Markdown

I am still seeing this warning on build Error when using sourcemap for reporting an error: Can't resolve original location of error.

I am using vite 6.3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-has-workaround 🍰 Bug, but has workaround (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lots of warnings when building project with Vite 5, Material UI and sourcemaps enabled

5 participants