webpack错误:plugins[0][1] must be an object, false, or undefined

报错信息:

ERROR in ./src/index.js
Module build failed (from ./node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js):
Error: .plugins[0][1] must be an object, false, or undefined

对比以前写的,发现babel-loader的版本不一样,回退到低版本后,运行成功:

npm install  babel-loader@7 babel-core babel-preset-env -D

 

前端项目的index.css文件中有@unocss preflights; @unocss default; 这个 运行项目后报错了Failed to compile, check the errors for troubleshooting. File: C:\Users\Lyun\Desktop\react-antd-admin-pro-main\src\index.css:1:1 × Module build failed: ╰─▶ × TypeError: Cannot read properties of undefined (reading '__esModule') │ at handleExports (C:\Users\Lyun\Desktop\react-antd-admin-pro-main\node_modules\@rspack\core\dist\cssExtractLoader.js:170:40) │ at C:\Users\Lyun\Desktop\react-antd-admin-pro-main\node_modules\@rspack\core\dist\cssExtractLoader.js:264:7 │ at C:\Users\Lyun\Desktop\react-antd-admin-pro-main\node_modules\@rspack\core\dist\index.js:6301:13 @ ./src/index.tsx File: C:\Users\Lyun\Desktop\react-antd-admin-pro-main\src\index.css:1:1 × Module build failed: ╰─▶ × Error: UnoCSS config not found: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' │ at plugin (file:///C:/Users/Lyun/Desktop/react-antd-admin-pro-main/node_modules/@unocss/postcss/dist/esm.mjs:198:13) │ at async plugins (C:\Users\Lyun\Desktop\react-antd-admin-pro-main\node_modules\@unocss\postcss\dist\index.cjs:11:16) │ at async LazyResult.runAsync (C:\Users\Lyun\Desktop\react-antd-admin-pro-main\node_modules\@rsbuild\core\compiled\postcss\index.js:1088:17) │ at async Object.loader (C:\Users\Lyun\Desktop\react-antd-admin-pro-main\node_modules\@rsbuild\core\compiled\postcss-loader\index.js:99:20)
最新发布
08-23
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值