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
This syntax requires an imported helper but module 'tslib' cannot be found. ts(2354)
when using export * from './other' in TS 4.5.2, and downgrading to TS 4.4.4 solves it. This is with yarn 3.1.0 and pnp, but apparently someone else could observe the same problem without pnp (can't verify). The error first hits me as a red mark in vscode, and also occurs when running tsc. I did not test, whether the problem exists with a plain setup using npm.
🔎 Search Terms
Searching for the related error message yields a great many issues and articles, but all i could find were either resolved, or i couldn't be sure, whether it's the same. I'd not be surprised, if there was some issue for this i couldn't find. There is e.g. #46288 which however is closed, and the related change appears merged already.
🕗 Version & Regression Information
As mentioned, the problem starts happening in 4.5.2, and doesn't occur in 4.4.4. I could not properly test nightlies, as there is no yarn patch for it yet.
💻 Code
Repo: https://github.com/ASDFGerte/tstest need to run yarn install, and either allow vscode to use the project's TS version, or somehow run the tsc supplied by the integration. I did not test, whether this also happens without yarn.
Manual reproduction (as nothing complex is necessary):
create folder
open with vscode
yarn init -y
yarn set version berry
yarn add -D typescript
yarn add tslib
yarn dlx @yarnpkg/sdks vscode
yarn tsc --init
uncomment "importHelpers": true, in tsconfig.json
create file index.ts and add export * from ''; (note: from what i could see, whether the file for the re-exported module exists or not doesn't matter for showing the error, it will just additionally show the "Cannot find module ''" error. You can add the other file if wanted, it's also in the repo above)
allow vscode to use the project's ts version (either by the automatically appearing box in the lower right, or by >Typescript: Select Typescript Version... and selecting the workspace one
Setting the ts version from ^4.5.2 to 4.4.4 in package.json, followed by a yarn install and vscode command >Developer: Reload Window (or reloading TS, restarting vscode, ...) removes the error.
🙁 Actual behavior
error
🙂 Expected behavior
no error, as has been for a long time, or some minor setting change i can do to fix the error, if there was a breaking change.
The text was updated successfully, but these errors were encountered:
Duplicate of #46874, which mentions yarnpkg/berry#3722, where they mention it's been fixed with Yarn 3.1.1. You should update your Yarn version.
In general there's no official support for pnp, so any issue is likely on the side of Yarn / pnp (afaik they hacked in a support). You might want to follow #28289.
Thanks, upgrading to yarn 3.1.1 indeed solves the issue. There was a small problem with yarn, that caused 3.1.1 to not be downloaded immediately with yarn set version berry, which is fixed by now.
Bug Report
I am getting a
when using
export * from './other'
in TS 4.5.2, and downgrading to TS 4.4.4 solves it. This is withyarn
3.1.0 and pnp, but apparently someone else could observe the same problem without pnp (can't verify). The error first hits me as a red mark invscode
, and also occurs when running tsc. I did not test, whether the problem exists with a plain setup usingnpm
.🔎 Search Terms
Searching for the related error message yields a great many issues and articles, but all i could find were either resolved, or i couldn't be sure, whether it's the same. I'd not be surprised, if there was some issue for this i couldn't find. There is e.g. #46288 which however is closed, and the related change appears merged already.
🕗 Version & Regression Information
As mentioned, the problem starts happening in 4.5.2, and doesn't occur in 4.4.4. I could not properly test nightlies, as there is no yarn patch for it yet.
💻 Code
Repo: https://github.com/ASDFGerte/tstest need to run
yarn install
, and either allow vscode to use the project's TS version, or somehow run thetsc
supplied by the integration. I did not test, whether this also happens withoutyarn
.Manual reproduction (as nothing complex is necessary):
yarn init -y
yarn set version berry
yarn add -D typescript
yarn add tslib
yarn dlx @yarnpkg/sdks vscode
yarn tsc --init
"importHelpers": true,
intsconfig.json
index.ts
and addexport * from '';
(note: from what i could see, whether the file for the re-exported module exists or not doesn't matter for showing the error, it will just additionally show the "Cannot find module ''" error. You can add the other file if wanted, it's also in the repo above)>Typescript: Select Typescript Version...
and selecting the workspace oneSetting the ts version from
^4.5.2
to4.4.4
inpackage.json
, followed by ayarn install
and vscode command>Developer: Reload Window
(or reloading TS, restarting vscode, ...) removes the error.🙁 Actual behavior
error
🙂 Expected behavior
no error, as has been for a long time, or some minor setting change i can do to fix the error, if there was a breaking change.
The text was updated successfully, but these errors were encountered: