(!) Plugin typescript: @rollup/plugin-typescript TS2354: This syntax requires an imported helper but module 'tslib' cannot be found. code example

Example 1: This syntax requires an imported helper but module 'tslib' cannot be found.

{
  // ...rest of config
  "compilerOptions": {
    // ...rest of compiler options
    "baseUrl: ".",
    "paths": {
      "tslib" : ["path/to/node_modules/tslib/tslib.d.ts"]
    }
  }
}

Example 2: This syntax requires an imported helper named '__spreadArrays' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'.

npm install tslib

Tags:

Misc Example