question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`TS2354` error: `module 'tslib' cannot be found` -- use `moduleResolution: "node"`

See original GitHub issue

tsconfig.json

{
  "compilerOptions": {
      "outDir": "dist",
      "module": "es2015",
      "target": "es2015"
  },
  "include": [
      "src"
  ]
}

src/test.ts

export default async function hello() {
  console.log('Hello world')
}

run rollup -c Error:

Error: rpt2: rollup-example/src/test.ts (3,23): semantic error TS2354 This syntax requires an imported helper but module 'tslib' cannot be found.

but change to rollup-plugin-typescript, run successful.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ezolenkocommented, Aug 22, 2017

Ah, I think you need "moduleResolution": "node", in your tsconfig.json.

0reactions
agilgur5commented, May 26, 2022

Duplicate of #12 / #14

Read more comments on GitHub >

github_iconTop Results From Across the Web

"This syntax requires an imported helper but module 'tslib ...
This results in an error: src/index.ts:5:1 - error TS2354: 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 >
this syntax requires an imported helper named '__spreadarray'
"This syntax requires an imported helper but module 'tslib' cannot be found" with ES2015 modules. Asked Oct 14, 2018 • 181 votes 19...
Read more >
this syntax requires an imported helper but ... - Code Grepper
this syntax requires an imported helper but module 'tslib' cannot be found.ts(2354). Add Answer | View In TPC Matrix. Technical Problem Cluster First ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found