-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
transpilePackages causes use of 'import.meta' outside a module, breaking dev mode #56487
Comments
isn't Pino a pure Node.js log tool? I don't think it is compatible with browser environment |
@galaxynova1999 No, that's not accurate. Pino includes a Browser API via a browser.js bundle. Pino is also recommended in the Next.js documentation. |
same issue occurs to my project. |
same issue here after deleting node_modules and reinstalling them |
### What We're applying react-refresh to browser layer and inject ESM or CJS helper based on file type. Some package from `trasnpilePackages` might contain CJS browser bundle. And injecting ESM helper breaks them. Actually they don't need to have fast refresh ability since they're in `node_modules`. ### How Skip react-refresh for transpiled packages as they're in node_modules and won't change. Fixes #56487 Closes NEXT-2061
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Link to the code that reproduces this issue
https://github.com/sawyerh/nextjs-pino-transpilePackages-bug
To Reproduce
This bug happens when
pino
is in thetranspilePackages
config array.Using the linked repo:
To reproduce the bug, run the application in dev mode:
You will see the following error:
To resolve the issue, remove
transpilePackages
fromnext.config.js
and restart the server.Current vs. Expected behavior
next dev
fails to run successfully whenpino
is in thetranspilePackages
config, butnext build && next start
works as expected. I expectednext dev
to also run successfully.I am transpiling
pino
in order to support Firefox versions prior to 71.Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:30 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T8103 Binaries: Node: 18.12.1 npm: 8.19.2 Yarn: 1.22.19 pnpm: 8.4.0 Relevant Packages: next: 13.5.4 eslint-config-next: N/A 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
A similar
import.meta
error message was reported in #35110 however it's not caused by usage oftranspilePackages
.NEXT-2061
The text was updated successfully, but these errors were encountered: