-
Notifications
You must be signed in to change notification settings - Fork 1
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
Export package as (clean) ESM #159
Comments
Oh yeah , this kind of makes sense to me 😞 You app (nextjs?) should be importing from The "type": "module",
"main": "./dist/areaKeys.cjs",
"module": "./dist/areaKeys.mjs",
"exports": {
"require": "./dist/areaKeys.cjs",
"import": "./dist/areaKeys.mjs",
"*": "./*"
}, My guess is that, you can't do this - I dont know why, maybe it doesn't like the '*': import * as ak from 'id-area-keys'; Maybe try import {isArea, areaKeys} from 'id-area-keys'; |
I tried the named imports and that does work (the tests are green). However the .js file that is Googling around (vercel/next.js#58626, mswjs/msw#1252), it sounds like I should test around with …
I looked at the two package checker that I know and they are happy with the what they see… |
This is more of a stub of an issue and a note to self.
During work on a NextJS based OSMCha frontend (not public yet), I noticed that I cannot import the mapbox/real-changesets-parser due to import errors with this library.
I then rewrote the parser in TS at https://github.com/tordans/real-changesets-parser but kept the library.
I am now using a build version of that packages (which I build using bun) as a hard copy in the NextJS project which works but still results in error messages like …
I think that error is due to the id-area-keys (but I did not verify that yet).
Long story short, for the mentioned NextJS based OSMCha we need a improved export for this library. Unfortunately I don't know a lot about the whole NPM/ESM stuff, so any hints are welcome … (that goes for the tordans/real-changesets-parser library as well).
Update: I found the error message I had initially when I tried to use the mapbox npm package of the real-changeset-parser
The text was updated successfully, but these errors were encountered: