-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
Renamed ESM files to .mjs instead of .js #454
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Just as a note: As you might see in my referenced repository I have But that's on you. I can do both or just the //edit: I'd like to add that after a little bit more research this doesn't necessarily seems to be a framework problem but a Node problem as the error is reported by the |
hi @activenode! I'm working of v2 here: #439, can you implement this solution in v2 library? React version of Tabler Icons will be moved to |
@activenode is right, but I wanted to give a bit more details. esbuild's docs explain the state of things quite well:
We'll definitely need |
Thanks for the clarification @anthonyalayo . Really helpful on top of mine. I will open a PR as @codecalm requested however I figure it might still be sensible to merge this one? |
@activenode if you can implement it in v2 I'll be very gratefull :) |
Closing this in favor of a potential new PR |
Hey there. We are using
@tabler/icons
as a dependency of a dependency.The setup:
some-lib using @tabler/icons@latest
some-lib
importing icons via ESMnextjs
package usingsome-lib
Now there are apparently libraries such as NextJS that have problems detecting sub-dependencies correctly when the imported ESM files aren't named
.mjs
.Surely there is work to do on those libraries (being discussed as well here: vercel/next.js#39375 (comment)) but since
.mjs
is a very common format forESM
, also being used in my own packages such as https://github.com/activenode/react-use-focus-trap/blob/main/package.json#L35 I am herewith recommending the change for the ESM files from.js
to.mjs
with a Pull Request with only positive impact IMO.If you have any questions please go ahead.
Sources: