我安装了一个新包 `@polkadot` 之后我收到错误消息

问题描述 投票:0回答:0

./node_modules/@polkadot/x-global/packageInfo.js 3:14 模块解析失败:意外令牌 (3:14) 文件是用这些加载器处理的:

  • ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js 您可能需要一个额外的加载器来处理这些加载器的结果。 |导出常量 packageInfo = { |名称:'@polkadot/x-global',

路径:import.meta && import.meta.url ?新 URL(import.meta.url).pathname.substring(0, 新 URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', |类型:'esm', |版本:'12.0.1'

尝试使用 .babelrc 文件

{ "presets": [ "@babel/preset-env", "@babel/preset-react", "es1015", "es2016", "es2017", "es2018", "es2019", "es2020", "es2021" ], "plugins": [ "@babel/plugin-proposal-optional-chaining", "@babel/plugin-proposal-nullish-coalescing-operator", "@babel/plugin-syntax-dynamic-import" ] }

node-modules babel-loader react-scripts unexpected-token
© www.soinside.com 2019 - 2024. All rights reserved.