reactjs - Parcel 构建失败`bundle.scss:undefined:undefined: plugin is not a function`
问题描述
我正在为我的学习项目使用包裹捆绑器并尝试为其创建构建。我也在使用 scss 文件。在bundle.scss
我已经导入了我所有的 scss 文件。并bundle.scss
导入App.js
.
所以在运行时parcel build index.html
,我收到以下错误。
/src/style/bundle.scss:undefined:undefined: plugin is not a function
at LazyResult.run (/usr/local/lib/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:288:14)
at LazyResult.asyncTick (/usr/local/lib/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:212:26)
at /usr/local/lib/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:254:14
at new Promise (<anonymous>)
at LazyResult.async (/usr/local/lib/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:250:23)
at LazyResult.then (/usr/local/lib/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:131:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xxxxx complete: `parcel build index.html`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xxxxx complete script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /.npm/_logs/2021-06-12T17_37_55_156Z-debug.log
我的项目结构
src/
-App.js
-styles/
--bundle.scss
--app.scss
-index.html
任何建议都会对我有真正的帮助,谢谢。
解决方案
这似乎是 Parcel 中的一个错误nanocss
。我只能通过根本不缩小css来修复它,使用
parcel build --no-minify
推荐阅读
- macos - 无法在 docker 容器内访问 kubectl port-forward
- python - 一列的平均值基于另一列的值
- netsuite - 显示活跃的父母和不活跃的孩子
- vue.js - 使用 require 在 vue 中显示图像导致 vue 应用程序重新渲染
- rhel7 - ASAN:进程中止时未生成核心文件
- javascript - 生成的 blob 不包含完整的数据集
- javascript - 尝试在javascript中使用laravel资产()助手异步显示图像
- javascript - NodeJS MySQL池死了没有抛出异常
- ios - 增加 IOS 平台版本对 react-native-maps 抛出错误,减少它对其他 react-native 库抛出错误
- amazon-web-services - Amazon API Gateway:有没有办法像在 AWS 控制台中测试 REST API 一样测试 HTTP API?