vuepress: Error in build (postcss_1.default is not a function)
This error appeared after I cleared my modules directory and reinstalled from scratch (no package-lock.json). I cleared npm cache, and tested on a completely blank project with only a single readme.md file with no configuration changes and it fails in the exact same way.
OS: Window 10 Node: 9.5.0 VuePress: 0.8.4 Local install (npm)
Error message:
ERROR in ./site/.vuepress/theme/Page.vue?vue&type=style&index=0&lang=stylus (./node_modules/css-loader??ref--11-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/lib??ref--11-oneOf-1-2!./node_modules/stylus-loader??ref--15-oneOf-1-3!./node_modules/vue-loader/lib??vue-loader-options!./site/.vuepress/theme/Page.vue?vue&type=style&index=0&lang=stylus)
Module build failed: TypeError: postcss_1.default is not a function
at compileStyle (D:\Development\Keiser\Keiser.Web\Keiser.Web.Dev\node_modules\@vue\component-compiler-utils\dist\compileStyle.js:34:35)
at Object.module.exports (D:\Development\Keiser\Keiser.Web\Keiser.Web.Dev\node_modules\vue-loader\lib\loaders\stylePostLoader.js:9:33)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 17 (4 by maintainers)
Fixed in
@vue/component-compiler-utils@1.2.1Reported an issue (https://github.com/vuejs/component-compiler-utils/issues/9) to @component-compilter-utils, please wait patiently.
This issue didn’t exist yesterday when I performed a clean install, so it’s most likely the result of a release from the last day or so.
@dolare No problem! the
resolutionsattribute is great for when this happens or when you need to keep a dependency “flat” across all modules of an app@dolare @bayssmekanique
Instead of messing up with
compileStyle.js, add this to yourpackage.json:This will use the previous version of
@vue/component-compiler-utilsand everything will work as expected!I’m fairly certain the bug is in https://github.com/vuejs/component-compiler-utils/commit/1456e3dc07c260dad276356be778a0dcb9fc6787