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

NCC fails to pack project that uses latest version of null-writable #1217

Closed
Vampire opened this issue Sep 19, 2024 · 3 comments
Closed

NCC fails to pack project that uses latest version of null-writable #1217

Vampire opened this issue Sep 19, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Vampire
Copy link

Vampire commented Sep 19, 2024

https://www.npmjs.com/package/null-writable changed to being an ESM module in v2.
Now it cannot be packed by NCC anymore.
With 1.0.5 packing works like a breeze.
But as soon as you use 2.0.0 or 2.0.1 of null-writable, you get the following error message:

ncc: Version 0.38.1
ncc: Compiling file index.js into ESM
Error: Module not found: Error: Default condition should be last one
Did you mean './null-writable'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
    at ...\node_modules\@vercel\ncc\dist\ncc/index.js.cache.js:38:1896272
    at ...\node_modules\@vercel\ncc\dist\ncc/index.js.cache.js:38:396262
    at _done (eval at create (...\node_modules\@vercel\ncc\dist\ncc/index.js.cache.js:21:75523), <anonymous>:9:1)
    at eval (eval at create (...\node_modules\@vercel\ncc\dist\ncc/index.js.cache.js:21:75523), <anonymous>:34:22)
@styfle styfle added bug Something isn't working help wanted Extra attention is needed labels Sep 20, 2024
@LoganArnett
Copy link

This is appears to be true for most ESM modules as I am seeing this same issue with the update in @middy/core
https://www.npmjs.com/package/@middy/core

@Vampire
Copy link
Author

Vampire commented Oct 30, 2024

Actually, now I have it working, but I changed quite some things and don't know right now what change caused it to work now.

@styfle
Copy link
Member

styfle commented Oct 30, 2024

Closing as non-issue since the null-writable dependency has an invalid package.json

@styfle styfle closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants