Error "File is a commonJS module; it may be converted to an ES6 module. ts(80001)"

Viewed 5314

Developing javascript in vscode, I see this error on line const Koa = require("Koa");:

File is a CommonJS module; it may be converted to an ES6 module. ts(80001)

and after I search found only 1 solution to disable all suggestionActions.

how I disable only "require" error without disabling all suggestionActions?

1 Answers

It's hinting to convert the code to support ES module standards. ES module is a standard module format that both browsers and the backend node environment support.

Related