Missing default-branch in exports in package.json
Describe the bug
In Version 1.16, the export-clause was introduced in the package.json using conditional exports for import, require and types.
That leads to the problem that the library cannot be used in other enviroments, because the default-case is missing. In our case the import using shadow-cljs failes.
Node.js also recommends to add a default if possible, see https://nodejs.org/api/packages.html#conditional-exports
Expected behavior
json-edit-react should provide a default case in exports
Okay, thanks for the heads-up, I'll fix this next week (unless someone else wants to make a PR)
Hi @dobretzberger -- I've updated this in v1.17.1. Can you confirm it's working okay for you?
Oh, hey, I'm sorry. I got the Closed-Email, but no Notification of your responses between.
Im afraid your improvement doesn't help. (Testet with 1.17.2) But I did some investigation now, and it seems that the following replacement of exports in the package.json solves my problem:
"exports": {
".": {
"types": "./build/index.d.ts",
"import": "./build/index.esm.js",
"require": "./build/index.cjs.js",
"default": "./build/index.esm.js"
}
},
Maybe this also helps for #128 ?
@dobretzberger Thanks a lot for that suggestion. I've updated it to that in 1.17.3 if you'd like to give it a try.\
I have to say, I don't know too much about this kind of thing, and the online resources seem to be in a constant state of evolution. It's hard to get it working properly for every environment, so any help is appreciated.
Yeah, that works. Thanks for the release!
Unfortunately, my knowledge about that stuff is also very limited...
Yeah, that works. Thanks for the release!
Great to hear 🎉