在vscode中开发javascript,在const Koa = require("Koa");
线上看到这个错误:
File is a CommonJS module; it may be converted to an ES6 module. ts(80001)
在我搜索后发现只有 1 个解决方案可以禁用所有建议操作。
如何在不禁用所有建议操作的情况下仅禁用“要求”错误?
最佳答案
它暗示将代码转换为支持 ES 模块标准。 ES 模块是浏览器和后端节点环境都支持的标准模块格式。
关于javascript - 错误 "File is a commonJS module; it may be converted to an ES6 module. ts(80001)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56627958/