Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Shared package in NPM workspace being transpiled #57179

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

Closed
1 task done
MattIPv4 opened this issue Oct 21, 2023 · 3 comments
Closed
1 task done

Shared package in NPM workspace being transpiled #57179

MattIPv4 opened this issue Oct 21, 2023 · 3 comments
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@MattIPv4
Copy link
Contributor

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

  • I verified that the issue exists in the latest Next.js 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

@MattIPv4 MattIPv4 added the bug Issue was opened via the bug report template. label Oct 21, 2023
@will-stone
Copy link

will-stone commented Oct 25, 2023

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.

@nextjs-bot
Copy link
Collaborator

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.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Apr 22, 2025
@nextjs-bot
Copy link
Collaborator

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!

@nextjs-bot nextjs-bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

3 participants