Skip to content

Editor shows error on a valid TypeScript dynamic import statement  #70806

@gozzoo

Description

@gozzoo
  • VSCode Version: 1.32.3
  • OS Version: Win 10 32bit

Steps to Reproduce:

image

Here is the actuall error message:

Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.ts(1323)

This is the relevant tsconfig.json (in the same directory with the source file)

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc",
    "module": "commonjs",
  }
}

What is strange is that there are no errors when I'm comiling the file with tsc.

C:\work\project>npm run tsc:server

> project@0.10.0 tsc:server C:\work\project
> tsc -p server/tsconfig.server.json

Metadata

Metadata

Assignees

Labels

*questionIssue represents a question, should be posted to StackOverflow (VS Code)typescriptTypescript support issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions