You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As shown in the CodeSandbox repro, a shared package in an NPM workspace that is installed in a Next.js site appears to be transpiled, resulting in some standard ESM errors not being thrown. This shared package is located in node_modules, but is a symlink to within the NPM workspace, which I suspect is why it is being transpiled.
Current vs. Expected behavior
I would expect only the code in the Next.js site itself to be transpiled, not code located outside the site. At best, I'd expect a way to at least be able to disable transpiling of coe outside the site, or a way to mark specific NPM packages as external.
Verify canary release
I verified that the issue exists in the latest Next.js canary release
Ah! I've been trying to find the cause of this all day 😅 Thanks for this write-up @MattIPv4
We have a smoke-test app on component library mono-repo, and because of this bug, an issue with not using the .js extension on deep lodash imports (import noop from 'lodash/noop' etc.) meant our prod apps broke. This would have been caught if it were not for this unusual behaviour.
This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.
This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!
Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/silent-violet-5yzkcy
To Reproduce
As shown in the CodeSandbox repro, a shared package in an NPM workspace that is installed in a Next.js site appears to be transpiled, resulting in some standard ESM errors not being thrown. This shared package is located in node_modules, but is a symlink to within the NPM workspace, which I suspect is why it is being transpiled.
Current vs. Expected behavior
I would expect only the code in the Next.js site itself to be transpiled, not code located outside the site. At best, I'd expect a way to at least be able to disable transpiling of coe outside the site, or a way to mark specific NPM packages as external.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Binaries: Node: 18.18.2 npm: 9.8.1 Yarn: 1.22.19 pnpm: 7.1.0 Relevant Packages: next: 13.5.7-canary.11 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Additional context
No response
The text was updated successfully, but these errors were encountered: