webpack-contrib / stylus-loader

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

stylus-loader@5 - TypeError: this.getOptions is not a function #307

Closed thisVioletHydra closed 3 years ago

thisVioletHydra commented 3 years ago

Expected Behavior

Actual Behavior

Code

// webpack.config.js
// If your code blocks are over 20 lines, please paste a link to a gist
// (https://gist.github.com).
// additional code, HEY YO remove this block if you don't need it

How Do We Reproduce?

update "stylus-loader": "4.3.3", to "stylus-loader": " 5.0.0",

ERROR

 ERROR  in ./assets/stylus/regular/index.styl                                                 friendly-errors 19:07:37

Module build failed (from ./node_modules/stylus-loader/dist/cjs.js):                          friendly-errors 19:07:37
TypeError: this.getOptions is not a function
    at Object.stylusLoader (C:\FRONTEND\www\group-dashboard\group-dashboard-siteanalyzer\node_modules\stylus-loader\dist\index.js:19:24)
                                                                                              friendly-errors 19:07:37
 @ ./assets/stylus/regular/index.styl 4:14-263 14:3-18:5 15:22-271
 @ ./.nuxt/App.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js

File: ./assets/stylus/regular/index.styl

// main file
@import 'CONFIG'
@import 'glyphs'
@import 'reWriteTheme'

no problem "stylus-loader": "4.3.3",

alexander-akait commented 3 years ago

You still on webpack@4, run npm ls webpack, feel free to feedback

thisVioletHydra commented 3 years ago

You still on webpack@4, run npm ls webpack, feel free to feedback

❯ npm ls webpack
group-dashboard-siteanalyser@1.2.1 C:\FRONTEND\www\group-dashboard\group-dashboard-siteanalyzer
+-- @nuxtjs/eslint-module@3.0.2
| `-- eslint-webpack-plugin@2.4.3
|   `-- webpack@5.20.1 deduped
+-- babel-loader@8.2.2
| `-- webpack@5.20.1 deduped
+-- cache-loader@4.1.0
| `-- webpack@5.20.1 deduped invalid
+-- clean-webpack-plugin@3.0.0
| `-- webpack@5.20.1 deduped
+-- dotenv-webpack@6.0.0
| `-- webpack@5.20.1 deduped
+-- eslint-import-resolver-webpack@0.13.0
| `-- webpack@5.20.1 deduped
+-- eslint-loader@4.0.2
| `-- webpack@5.20.1 deduped
+-- friendly-errors-webpack-plugin@1.7.0
| `-- webpack@5.20.1 deduped invalid
+-- nuxt-purgecss@1.0.0
| `-- purgecss-webpack-plugin@2.3.0
|   +-- terser-webpack-plugin@1.4.5 extraneous
|   | `-- webpack@4.46.0 deduped
|   `-- webpack@4.46.0
|     `-- terser-webpack-plugin@5.1.1 invalid
|       `-- webpack@5.20.1
+-- nuxt@2.14.12
| `-- @nuxt/webpack@2.14.12
|   +-- @nuxt/friendly-errors-webpack-plugin@2.5.0
|   | `-- webpack@4.46.0 deduped
|   +-- css-loader@3.6.0
|   | `-- webpack@4.46.0 deduped
|   +-- extract-css-chunks-webpack-plugin@4.9.0
|   | `-- webpack@4.46.0 deduped
|   +-- file-loader@4.3.0
|   | `-- webpack@4.46.0 deduped
|   +-- hard-source-webpack-plugin@0.13.1
|   | `-- webpack@4.46.0 deduped
|   +-- html-webpack-plugin@4.5.1
|   | `-- webpack@4.46.0 deduped
|   +-- optimize-css-assets-webpack-plugin@5.0.4
|   | `-- webpack@4.46.0 deduped
|   +-- style-resources-loader@1.4.1
|   | `-- webpack@4.46.0 deduped
|   +-- terser-webpack-plugin@2.3.8
|   | `-- webpack@4.46.0 deduped
|   +-- thread-loader@2.1.3
|   | `-- webpack@4.46.0 deduped
|   +-- time-fix-plugin@2.0.7
|   | `-- webpack@4.46.0 deduped
|   +-- url-loader@2.3.0
|   | `-- webpack@4.46.0 deduped
|   +-- vue-loader@15.9.6
|   | `-- webpack@4.46.0 deduped
|   +-- webpack-dev-middleware@3.7.3
|   | `-- webpack@4.46.0 deduped
|   +-- webpack@4.46.0
|   | `-- terser-webpack-plugin@1.4.5
|   |   `-- webpack@4.46.0 deduped
|   `-- webpackbar@4.0.0
|     `-- webpack@4.46.0 deduped
+-- stylus-loader@4.3.3
| `-- webpack@5.20.1 deduped
+-- terser-webpack-plugin@5.1.1
| `-- webpack@5.20.1 deduped
+-- ts-loader@8.0.14
| `-- webpack@5.20.1 deduped
+-- webpack-cli@4.5.0
| +-- @webpack-cli/configtest@1.0.1
| | `-- webpack@5.20.1 deduped
| `-- webpack@5.20.1 deduped
+-- webpack@5.20.1
`-- webpackbar@5.0.0-3
  `-- webpack@5.20.1 deduped
alexander-akait commented 3 years ago

As you can see nuxt@2.14.12 uses webpack@4.46.0

thisVioletHydra commented 3 years ago

As you can see nuxt@2.14.12 uses webpack@4.46.0

ok i went to pester the nuxt community