In the past two days, I re-learned the use of Webpack. When learning to package css/less style resources, an error occurred:
The key error message is: this.getOptions is not a function. After a look at Baidu on the Internet, it is a version problem.
Then I checked the npm official website again, and it turned out that less-loader released a new version of 8.0.0 22 days ago, which is likely to be a compatibility issue caused by the new version.
Solution: Uninstall less-loader and download a lower version again so that it can be packaged normally.
cnpm uninstall less-loader cnpm i -D less-loader@7 // The latest version is 8.0.0, so re-download the latest version of version 7
Read More:
- Webpack Error: Module build failed: TypeError: this.getOptions is not a function
- Syntax Error: TypeError: this.getOptions is not a function
- [Solved] Vue Install less Error: this.getOptions is not a function
- Taro Use React Hooks Error: TypeError: Object(…) is not a function
- TypeError: res.render is not a function
- TypeError: db.collection is not a function
- TypeError: ‘WebElement’ object is not iterable error
- [Solved] MongoDB Error: TypeError: Object of type ObjectId is not JSON serializable
- How to Fix Webpack run error webpack dev server
- [Solved] Webpack compilation Error: Cannot find module’webpack-cli/bin/config-yargs’
- Uncaught (in promise) Error: Delete success at __webpack_exports__.default 405 error
- Solve the data transfer between vue irrelevant components error: this.$store.commit is not a function
- [Solved] Maven Error: The packaging for this project did not assign a file to the build artifact
- [Solved] MindSpore Network custom reverse error: TypeError: The params of function ‘bprop’ of
- NPM install Error cb.apply is not a function
- [Solved] TypeError: Cannot read property ‘indexOf‘ of undefined at VueComponent.resetFields
- this.$el.querySelectorAll is not a function [How to Solve]
- [vite] Internal server error:options.devServer.transformWidthEsBuild is not a function…
- [Solved] Error: ‘attrition‘ is not an exported object from ‘namespace:rsample‘