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

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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nirmitha