next build
fails on importing a packaging via its conditional export
#45452
Labels
next build
fails on importing a packaging via its conditional export
#45452
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
TypeScript
Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-fkhtk7?file=pages/index.tsx
To Reproduce
next dev
and see it succeedstsc --noEmit
and see it succeedsnext build
and see it fails withType error: Cannot find module '...' or its corresponding type declarations.
Describe the Bug
This is probably a perfect clone of #43698 , however I think the issue is NOT on Typescript side.
The main difference with the other issue is that running
tsc --noEmit
works perfectly, while usingmoduleResolution: node16
. It (correctly) fails while usingmoduleResolution: node
, since exports only work with node16/nodenext.next build
, however, always fails.I saw #44177 merged in the latest canary, but while
dev
works perfectly (and I'm able to use the components),build
compiles correctly but fails in type checking. Maybe something else is missing?Expected Behavior
The build should work
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: