Closed najamelan closed 2 years ago
Hmm, I'm getting lost a bit in the cypress repository, but it might be that they use webpack 4, which does not support exports.
Yes, I think that's the problem actually. Looking through my other dependencies, everything seems to have a main key in package.json, even when they also supply exports.
Maybe it's worth keeping main around for now, for compatibility.
Thanks for raising this, I'll take a look soon.
I have pushed/published a new release which addresses this and makes a couple of other planned changes. You should be able to install under the same tag as before.
https://www.npmjs.com/package/oxide.ts/v/1.0.0-next.10
Does this release also fix the problem you are having? I'd initially thought that main/exports were mutually exclusive but it seems that exports just overrides main - I'm not sure how this will play ball with webpack 4.
Cheers
Yes! this solves the issue. As I said, other packages I checked just seem to have them side by side as well. Now im trying to make the webpack 4 in cypress accept nullish operator...sigh...
Thanks for the quick fix ;)
ps: actually, let's hope this saves my day: https://adamlynch.com/preprocess-cypress-tests-with-vite/
I'm using oxide.ts in a project that I try to test with cypress. Cypress uses webpack. When switching from oxide.ts 0.9.12 to 1.0.0, my application runs fine in the vite dev server, but when testing with cypress I get the following error when I try to import a module from my app in the cypress integration test:
Seems like it can't find the entry point for the lib. So I had a quick look at the package.json and the difference seems to be the switch from "main" to "exports". And effectively when I add the "main", even leaving exports in place the issue get's resolved.
Not sure where the blame lies for this one, whether it's a problem with package.json or with webpack. If you need a MRE, let me know.