Ionic 2 allowJs produces comile error

206 Views Asked by At

I am trying to implement a custom JS library that I have written into a TypeScript Ionic 2 project. I have no typings because I wrote it myself.

For that I changed my tsconfig to

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5",
    "allowJs": true
  },
  "include": [
    "src/**/*"
  ],
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

after that I get the following errors in console (let's ignore the metamask line, it's from a plugin):

screenshot

Also I have tried changing the outDir in compile options without success.

Any ideas or should I switch to vanillaJs?

1

There are 1 best solutions below

0
On

I just realized it was all atop a node library and i forgot that, will need to set a server up for this to work.