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

Error: Cannot find module 'tslib' #73

Closed
wojtekmaj opened this issue Apr 17, 2024 · 4 comments · Fixed by #82
Closed

Error: Cannot find module 'tslib' #73

wojtekmaj opened this issue Apr 17, 2024 · 4 comments · Fixed by #82

Comments

@wojtekmaj
Copy link

wojtekmaj commented Apr 17, 2024

It appears that the source code requires tslib:

node_modules/eslint-plugin-import-x/lib/index.js

"use strict";
const tslib_1 = require("tslib");
const electron_1 = tslib_1.__importDefault(require("./config/electron"));
const errors_1 = tslib_1.__importDefault(require("./config/errors"));
const react_1 = tslib_1.__importDefault(require("./config/react"));
// …

but the package does not declare it in its dependencies. This causes the error if tslib has not been already installed by another package, and in Yarn PnP, unconditionally.

@karlhorky
Copy link

I'm able to confirm this also with pnpm - I experienced this today in one of our projects using eslint-plugin-import-x

@JounQin what do you think about this one? Should tslib be added as a dependency?

karlhorky added a commit to upleveled/eslint-config-upleveled that referenced this issue May 20, 2024
karlhorky added a commit to upleveled/eslint-plugin-upleveled that referenced this issue May 20, 2024
Fix issue with missing tslib dependency from eslint-plugin-import-x

- un-ts/eslint-plugin-import-x#73
@danciudev
Copy link

Same problem with pnpm and bun.

@JounQin
Copy link
Member

JounQin commented May 24, 2024

Oh, it should be listed as dep, PR welcome.

unzico pushed a commit to unzico/eslint-plugin-import-x that referenced this issue May 24, 2024
tslib is required as a runtime dependency but not installed in this project.

Fixes un-ts#73.
@unzico
Copy link

unzico commented May 24, 2024

Oh, it should be listed as dep, PR welcome.

Opened a PR: #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants