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

tslib must be a dependency and not a devDependency #1

Open
iainmerrick opened this issue Jun 16, 2022 · 0 comments · May be fixed by #2
Open

tslib must be a dependency and not a devDependency #1

iainmerrick opened this issue Jun 16, 2022 · 0 comments · May be fixed by #2

Comments

@iainmerrick
Copy link

(Borrowing from dojo/core#372, which has a really clear writeup of the same bug in a different NPM package)

When this package is installed, the generated .js files contain require("tslib"). So tslib needs to be in dependencies, not just devDependencies.

Here's a simple repro case:

$ npm install remix-mount-routes --no-package-lock --global-style   

added 4 packages, and audited 5 packages in 2s

found 0 vulnerabilities
$ node -e "require('remix-mount-routes')"                           
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'tslib'

This bug is often disguised when using npm, as some other package in your project will likely depend on tslib. But it won't work in pnpm without --shamefully-hoist as pnpm doesn't expose transitive dependencies by default.

@iainmerrick iainmerrick linked a pull request Jun 16, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant