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 named export resolving order #306

Merged
merged 1 commit into from
Jan 11, 2021
Merged

Conversation

amoutonbrady
Copy link
Member

@amoutonbrady amoutonbrady commented Jan 10, 2021

As I worked on my vite-plugin-solid, it came to my attention that a certain version of Vite broke the resolution of solid-js/web.

error during build:
Error: 'template' is not exported by node_modules/.pnpm/[email protected]/node_modules/solid-js/web/dist/server-async.js, imported by node_modules/.pnpm/[email protected][email protected]/node_modules/solid-app-router/dist/index.jsx

Digging a bit, I found it to be related to this issue: vitejs/vite#1418. As it turn out Jason Miller is on a mission to unify bundlers to try and be spec compliant.

The way Evan You handled it in Vite is that he resolves then browser entry, then node entry and then the default import. Since node is above the defaults in the solid-js/web export mapping, this is the one being picked up by Vite (and supposedly other tool that follows this spec I suppose).

Therefore, I do believe that adding a browser entry above the node one should suffice to fix the issue.

I don't think it should impact anything, but I could be wrong on that one.

edit: Patching the node_modules manually, indeed fix the issue.

This should makes integration with third party tools a bit better
@ryansolid ryansolid merged commit 6b28920 into solidjs:master Jan 11, 2021
@ryansolid
Copy link
Member

ryansolid commented Jan 11, 2021

Looks good.

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