Syntax Error: ValidationError: Invalid options object. Stylus Loader has been initialized using an

詩水人間發表於2021-01-03

報錯資訊如下:

Syntax Error: 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? }

原因是安裝的stylus是最新版本的,網上的資訊說換一個版本就可以解決。於是乎安裝下面的版本

npm install stylus-loader@3.0.2

相關文章