You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I implemented the suggested fix in vite-plugin-solid. It fixed the jsx analysis error, but uncovered another issue in how the modules are being resolved. It seems we end up with duplicate versions of the same module (and thus invalid global object references across them which breaks things like Context lookup in Solid JS).
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
I investigated this more and it could be with how vite was deciding whether to add version query hash or not. The correct thing is to add it for everything. So @patak-dev made a fix for this: #10141. Could we verify if this solves the problem?
We worked this through and it did address the issue (so long as we also added "jsx" to optimizeDeps.extensions and relevant libraries to optimizeDeps.exclude).
Yeah excluding from optimizeDeps is needed right now because we dont add an esbuild loader for jsx files in vite-plugin-solid, so esbuild actually compiles to React code.
Describe the bug
Following on from #10087;
I implemented the suggested fix in
vite-plugin-solid
. It fixed the jsx analysis error, but uncovered another issue in how the modules are being resolved. It seems we end up with duplicate versions of the same module (and thus invalid global object references across them which breaks things likeContext
lookup in Solid JS).For example; in the repo https://github.com/thisbeyond/solid-dnd-site we end up with both of the following being resolved as separate versions of the same module:
/node_modules/@thisbeyond/solid-dnd/dist/source/drag-drop-context.jsx
/node_modules/@thisbeyond/solid-dnd/dist/source/drag-drop-context.jsx?v=bce1c9bf
And this causes different global instances of a Context lookup object (note the different ids) which breaks the code:
I think this might be similar to the issue #9828 but the issue is still present for us in Vite 3.1.1. Note that Vite 3.0.9 did not exhibit this bug.
Reproduction
https://github.com/thisbeyond/solid-dnd-site
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: