module 'tslib' cannot be found
See original GitHub issueHi guys. I’m getting this error when I run `node_modules/.bin/tsc’ in the following folder.
error TS2354: This syntax requires an imported helper but module ‘tslib’ cannot be found.
The offending line (rxjs/Subscriber.d.ts(13,36) does indeed include an innocent looking extend
keyword. Can you tell me what I’m doing wrong?
$ node_modules/.bin/tsc
node_modules/rxjs/Subscriber.d.ts(13,36): error TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.
src/main.ts
import { Observable } from "rxjs";
Observable.timer(3000, 5000)
.timeInterval()
.subscribe((interval) => console.log(interval));
tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"importHelpers": true,
"target": "es5",
"noEmitHelpers": true
}
}
package.json
{
"name": "stuff",
"version": "1.0.0",
"scripts": {
"build": "webpack"
},
"devDependencies": {
"@types/core-js": "^0.9.35",
"ts-loader": "^1.3.2",
"typescript": "^2.1.4",
"webpack": "^2.1.0-beta.25"
},
"dependencies": {
"rxjs": "^5.0.1",
"tslib": "^1.2.0"
}
}
rxjs/Subscriber.d.ts(13)
export declare class Subscriber<T> extends Subscription implements Observer<T> {
I posted my question to stackoverflow but can’t get any interest
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
"This syntax requires an imported helper but module 'tslib ...
9. After updating to Ng12, with tslib already installed and getting This syntax requires an imported helper but module 'tslib' cannot be found....
Read more >TypeScript error “TS2354: This syntax requires an ... - GitHub
js:3:8 - error TS2354: This syntax requires an imported helper but module 'tslib' cannot be found. 3 const {ArgumentParser} = require('argparse') ...
Read more >This syntax requires an imported helper but module 'tslib ...
To solve the error "This syntax requires an imported helper but module 'tslib' cannot be found", install tslib by running npm install -D...
Read more >tslib - npm
This is a runtime library for TypeScript that contains all of the TypeScript helper functions. This library is primarily used by the -- ......
Read more >How to fix Visual Studio throwing a "This syntax requires an ...
Fixing “This syntax requires an imported helper named '__spreadArray' which does not exist in 'tslib'. Consider upgrading your version of 'tslib ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
try npm install --save tslib, thats what helped me out.
We should be publishing 2.1.5 with he fix soon.