-
Notifications
You must be signed in to change notification settings - Fork 71
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
TS2354 This syntax requires an imported helper but module 'tslib' cannot be found.
#12
Comments
This is definitely supposed to work transparently (and works for me in my own projects). I'll try your exact setup, thanks. |
Looks like you need Not sure if that could pose problems on non-node setups, but I haven't heard anything to that effect yet. |
Indeed, with I see that you opened #14 for the |
Not sure anyone else facing the same problem as mine. I was having this problem rollup/rollup-plugin-typescript#109, therefore I switch to this repo, but then I'm getting this as the tsconfig is already |
If you post your tsconfig, rollup config and package.json, somebody might spot something amiss. |
@hueitan i faced the same issue while already having |
adding |
Do you use |
in my case i am using yarn. Deleting the yarn.lock and reinstalling fresh, i do not need an explicit mention of I can reproduce it in the following repo: https://github.com/giniedp/tweak-ui git clone [email protected]:giniedp/tweak-ui.git
cd tweak-ui
git checkout v0.1.0 now edit the yarn install
yarn run build you should run into
now delete the yarn install
yarn run build runs fine. |
This was fixed with this
Fixed! Mine was in regular |
Fixed it by adding |
npm i tslib -D worked for me too |
Like @ezolenko says: While
What worked in my case and is the better solution is to delete package-lock and node_modules and reinstall.
|
Thank you, It's so helpful |
None of the proposed solutions worked for me. Upgrading
It turns out rollup was using |
Weird behavior, But restarting VS code worked for me. I didn't have the issue previously, it just came up after doing an package install. |
Thanks. Just added to |
I had this error:
Fixed it by adding |
You can simply upgrade your |
- to fix module 'tslib' cannot be found error - ref: ezolenko/rollup-plugin-typescript2#12
* chore: add .yarnrc.yml * chore: add yarn-berry.cjs * chore: install packages with yarn berry * chore: ignore yarn related files * chore: remove package-lock.json * chore: enable Plug'n'Play * chore: enable vscode integrations - ref: https://yarnpkg.com/getting-started/editor-sdks * chore: enable Yarn's Typescript plugin - helps manage `@types/*` dependencies automatically - ref: https://github.com/yarnpkg/berry/tree/master/packages/plugin-typescript * chore: upgrade rollup-plugin-typescript2(v0.30.0), add tslib - to fix module 'tslib' cannot be found error - ref: ezolenko/rollup-plugin-typescript2#12 * chore: install yarn pnpify * test: fix "cannot find global" ts error * chore: remove .yarn/install-state.gz * ci: apply yarn to CI workflow scripts * docs: update CONTRIBUTING to use yarn berry * ci: update CI workflow to not use actions-yarn - 퍼포먼스가 30초 vs 2초로 너무 파멸적으로 차이나기 때문에 배제했습니다. * docs: fix typo in CONTRIBUTING * chore: add yarn files, dir to .npmignore * chore: install amplitude-js with yarn * test: remove unnecessary global
TS2354 This syntax requires an imported helper but module 'tslib' cannot be found.
I see that the code has some references to
tslib
andimportHelpers
so I assume this should work transparently. If not, I'll be happy to know what is missing.Here is how to reproduce:
Installed packages:
tsconfig.json
:rollup.config.js
:main.ts
:And
module.ts
:When running rollup as follows:
I get this error:
I think this is because the
extends
syntax requires an__extends
helper fromtslib
, but typescript can't findtslib
.Expected result is that the required helpers become part of the bundle.
Thanks.
The text was updated successfully, but these errors were encountered: