webpack-contrib / stylus-loader

:art: A stylus loader for webpack.
MIT License
498 stars 99 forks source link

Invalid options object. Stylus Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'modules' #289

Closed PodaruDragos closed 4 years ago

PodaruDragos commented 4 years ago

Expected Behavior

Code Bundles corectly.

Actual Behavior

Code Dosen't bundle.

Working Code Before 4.0.0

        {
          loader: 'stylus-loader',
          options: {
            importLoaders: 2,
            modules: true,
            preferPathResolver: 'webpack',
            sourceMap: isSourceMap
          }
        }

Error with 4.0.0

 These properties are valid:
   object { stylusOptions?, sourceMap?, webpackImporter?, additionalData? }

How Do We Reproduce?

Upgrade to stylus-loader 4.0.0 in a project that uses stylus css modules. Did this upgrade break support for css modules entirely?

cap-Bernardito commented 4 years ago

In new release, there have been some changes Please update your config according to the documentation Modules you need to enable in css-loader

If this does not solve your problem, please provide a minimally reproducible test repository.

PodaruDragos commented 4 years ago

sure. here is the repository with a minimal code that breaks for V4.0.0 but works if you change it to V3.0.2. it also breaks for modules. also it appears that just importing an empty .styl file doesn't break anything.

repro

cap-Bernardito commented 4 years ago

Thanks for repo. An error occurs here when generating a sourcemap. We will fix this soon. For now, you can temporarily disable sourcemaps. Sorry for the inconvenience.

Close in favor #287