Closed sawyerh closed 10 months ago
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.
@sawyerh — were you able to find a workaround to this? cc: @lavelle
@sawyerh — were you able to find a workaround to this? cc: @lavelle
No
same issue occurs to my project. We built a monorepo using next.js v.13 with Jest Framework which is common js library. That's why I needed to set transpilePackages on next.config.js to transpile some ESM libiraries with swc. turbo run start and build works well, however run dev doesn't just like you mentioned.
same issue here after deleting node_modules and reinstalling them
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
Which area(s) are affected? (Select all that apply)
SWC transpilation
Additional context
A similar
import.meta
error message was reported in https://github.com/vercel/next.js/issues/35110 however it's not caused by usage oftranspilePackages
.NEXT-2061