Open dannygooze opened 1 year ago
Looks like it's related to my issue: https://github.com/vercel/next.js/issues/54286
Having this exact same error with Next 13 using turbo and @headlessui/react . It looks like this issue in turbo maybe related as well https://github.com/vercel/turbo/issues/4763
Ain't it already added in the latest version of the canary build? https://github.com/vercel/next.js/blob/canary/packages/next/src/server/config.ts#L674
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router, Dynamic imports (next/dynamic)
Link to the code that reproduces this issue or a replay of the bug
https:github.com/dannygooze/test-turbo-reo
To Reproduce
yarn create next-app --experimental-app
yarn add @headlessui/react
"next dev --turbo"
yarn dev
Describe the Bug
When running a next 13 app with turbo, yarn packages are having a hard time resolving due to the way turbo tries to modularize imports. I have tried updating the next config to get this to work and find the correct modules with no luck.
Here is what I have tried adding in my next config:
modularizeImports: { "@headlessui/react": { transform: "@headlessui/react/dist/components/{{kebabCase member}}/{{kebabCase member}}" } }
Expected Behavior
Expect this to run and import the components from yarn packages.
Which browser are you using? (if relevant)
Chrome
How are you deploying your application? (if relevant)
Vercel