-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Exports is undefined in dev if add "next" to transpilePackages #58114
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
Comments
I think it was my mistake, it works now, but I'm using 14.0.2 |
Actually it exists, but its a different bug. Its a bug in dev. Updating it now, when "next" is in the list, we get |
Investigation
|
I have a slightly different error, but also caused by adding In my case I was seeing
I narrowed this down to the fact that the dev server could not be transpiled, so it only errored in I fixed this by conditionally transpiling only for non-dev // next.config.js
{
...,
// don't transpile in dev server as it will fail
transpilePackages: process.env.NODE_ENV !== 'development' ? ['next'] : undefined,
} |
Link to the code that reproduces this issue
https://github.com/Noitidart/self-transpile
To Reproduce
{ node: 'v18.13.0', npm: '8.19.3' }
npx create-next-app@latest
package.json
and add"browserslist": ["supports es5"]
next.config.js
and addtranspilePackages: ['next']
npm run dev
.Current vs. Expected behavior
Dev should work.
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 Binaries: Node: 18.13.0 npm: 8.19.3 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 14.0.2-canary.17 eslint-config-next: 14.0.1 react: 18.2.0 react-dom: 18.2.0 typescript: 5.2.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
SWC transpilation
Additional context
No response
The text was updated successfully, but these errors were encountered: