Vue-cli: ValidationError: Invalid options object. Stylus Loader has been initialized using an options object that does not match the API schema.

Created on 12 Oct 2020  ·  8Comments  ·  Source: vuejs/vue-cli

Version

4.5.7

Environment info

"stylus-loader": "^4.1.1",

Steps to reproduce

install [email protected]

npm run serve

What is expected?

stylus compile successfully

What is actually happening?

 ERROR  Failed to compile with 1 errors                                                                                                                                10:42:34 PM

 error  in ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=stylus&scoped=true

Module build failed (from ./node_modules/stylus-loader/dist/cjs.js):
ValidationError: Invalid options object. Stylus Loader has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'preferPathResolver'. These properties are valid:
   object { stylusOptions?, sourceMap?, webpackImporter?, additionalData? }

image

intend to implement cli-service build cli-service serve

Most helpful comment

- "stylus-loader": "^4.2.0",
+ "stylus-loader": "^3.0.2",

This solves it, but I believe we should ensure that v4.x is supported while bundling the app

All 8 comments

Please use stylus-loader@3 at the moment.

I also encountered this problem, using stylus-loader v3 can solve it

I also encountered this problem, using stylus-loader v3 can solve it

确实有效,将stylus-loader的版本降低到3.0.2 能够成功编译

对,我也试过了,用3.0.2版本的stylus-loader就能编译通过。

- "stylus-loader": "^4.2.0",
+ "stylus-loader": "^3.0.2",

This solves it, but I believe we should ensure that v4.x is supported while bundling the app

nice

Thanks for posting the fix!

Thanks for posting the fix!

Was this page helpful?
0 / 5 - 0 ratings