Skip to content
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

Scope hoisting causes @parcel/transformer-js to constantly complain about require inside node_modules packages #9837

Open
LoganDark opened this issue Jul 9, 2024 · 0 comments

Comments

@LoganDark
Copy link

🐛 bug report

importing nearly any package from NPM results in complaints about their use of require:

@parcel/transformer-js: Conditional or non-top-level `require()` call. This causes the resolved module and all dependencies to be wrapped.

  node_modules/youtube-player/node_modules/debug/src/debug.js:14:20
    13 | exports.enabled = enabled;
  > 14 | exports.humanize = require('ms');
  >    |                    ^^^^^^^^^^^^^
    15 |
    16 | /**

  📝 Learn more: https://parceljs.org/features/scope-hoisting/#avoid-conditional-require()

🎛 Configuration (.babelrc, package.json, cli command)

N/A

🤔 Expected Behavior

console should only show warnings about my own code or about configuration errors

😯 Current Behavior

warning spam in console for no good reason

💁 Possible Solution

NPM packages should be ignored as I can't control the code in them

🌍 Your Environment

Software Version(s)
Parcel v2.12.0
Node v20.17.0
npm/Yarn Yarn v4.2.2
Operating System Ubuntu 20.04 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant