How to solve File has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'

Viewed 2357

I am unable to solve this particular error:

File 'D:/coreui-todo-app/node_modules/multiple-textbox/....' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.

The solution that I implemented is as follows.

Entering the value of

  "allowJs": true

in

"compilerOptions": {
    "importHelpers": true,
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowJs": true,
    "module": "esnext",
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "esnext",
      "dom"
    ]
  }

However, I am still facing the same issue.

The screenshot attached:

enter image description here


Updated screenshot as suggested by @Pointy to remove .spec.ts -

enter image description here

1 Answers

tsconfig.json has an unsupported extension

I solved it by adjusting my script.

tsc-watch --compiler typescript/bin/tsc

And removed the tsconfig.json from the command.

Related