繁体   English   中英

错误“文件是一个 commonJS 模块;它可能会转换为 ES6 模块。ts(80001)”

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

在 vscode 中开发 javascript,我在const Koa = require("Koa");行看到这个错误 :

File 是一个 CommonJS 模块; 它可以转换为 ES6 模块。 TS(80001)

在我搜索后发现只有 1 个解决方案可以禁用所有 suggestionActions。

如何在不禁用所有 suggestionActions 的情况下仅禁用“require”错误?

提示转换代码以支持 ES 模块标准。 ES模块是浏览器和后端节点环境都支持的标准模块格式。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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