Documentation: transpiling step seems not necessary with the pre-installed Next.js application
Verify canary release
- [x] I verified that the issue exists in the latest Turborepo canary release.
Link to code that reproduces this issue
https://github.com/atharva-youtube/turborepo-tutorial
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Which canary version will you have in your reproduction?
turbo 1.11.4-canary.1
Describe the Bug
The documentation mentions here that the package needs to be added under transpilePackages under next.config.js file. However, while filming the tutorial, when I tried to demonstrate the error without adding the package to transpilePackages, everything worked just fine.
It seems that the documentation targetted an older version of Next.js, and the newer Next.js version does the transpiling automatically (an assumption). I would love to know if I need to do something differently or if this is a problem. I would love to fix the documentation if an issue is assigned to me.
Expected Behavior
That part of the documentation should be removed.
To Reproduce
Clone the repository, install the packages using pnpm install, run pnpm dev and see the code working on http://localhost:3000. I have not added the shared-utils in transpilePackages under apps/web/next.config.js, but I'm still able to use it to add a button that performs addition using add() in the shared-utils package.
Additional context
No response
Interesting. I'll check with the Next.js team to see if this is known/unexpected behavior.
Sorry for being "that" guy who asks for update. It's been a while. Would love to contribute if the behaviour is not expected.
Apologies! I forgot to come back. 😄
We do need to keep it as this is unexpected behavior in Next.js (for now, as this is likely to be implemented in the future). Let's leave this here so that if the Next.js team decides to do a bug fix, we won't need to chase that.
Thank you for reporting this!
I just got an update on why those differences are being seen:
- The App Router bundles everything it needs, without the need for
transpilePackages. - The Pages Router only bundles what it sees in
transpilePackages.
Additionally, there will be updates to this behavior in the near future.