首页 > 解决方案 > react-loadable babel-plugin-import-inspector 不工作

问题描述

问题:

当我尝试启动节点服务器控制台尖叫:

/@babel/core/lib/transformation/file/file.js:173
throw new Error("This API has been removed. If you're looking for this " + "functionality in Babel 7, you should import the " + "'@babel/helper-module-imports' module and use the functions exposed " + " from that module, such as 'addNamed' or 'addDefault'.");

我发现使用函数 addImport() 的 babel-plugin-import-inspector 又被弃用并引发错误。

我不能停止使用这个插件,因为它与 react-loadable 高度相关;(

在这种情况下我该怎么办?我的 babel 版本是 7,可能我应该降级吗?

顺便说一句,babel 让我使用 @babel/helper-module-imports 并使用从该模块公开的函数,但我不明白如何使用。

谢谢!

标签: javascriptbabeljsreact-loadable

解决方案


我降级了,现在看起来一切正常。


推荐阅读