简体   繁体   中英

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

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:

在此处输入图像描述


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

在此处输入图像描述

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM