Open JuanM04 opened 3 years ago
The same problem occurs with v12.2.0
and this only happens with server-side rendering. Strangely enough only individual exports have this problem.
I checked your repro and it seems that cuit
and ncm
both have import {...} from '.'
.
Cyclic imports are really wonky and shouldn't be used (if possible).
What version of Next.js are you using?
10.0.8-canary.1
What version of Node.js are you using?
12, 15
What browser are you using?
All
What operating system are you using?
Linux
How are you deploying your application?
local
Describe the Bug
(Original issue: https://github.com/blitz-js/legacy-framework/issues/408)
I'm having some problems when importing. I have this validation folder with zod utilites:
Inside index.js, I have this:
When I import from
validation
, it throwsundefined
. If I change each import to its respective file (instead of a bigimport { ... } from 'validation'
, I doimport { .. } from 'validation/cuit'
orimport { .. } from 'validation/ncm'
), it works.What's weird is what happens when I rearrange the imports like this:
If I put
others
at the top, it just works.Expected Behavior
It should work no matter the export order.
To Reproduce
https://codesandbox.io/s/nextjs-exports-bug-pbri4