Webpack打包报错 TypeError: this.getOptions is not a function at Object.lessLoader
2021-02-23 23:15
1991 查看
这两天重新学习了一下Webpack的使用,在学习打包css/less样式资源时,发生了这样一个报错:
关键报错信息是: this.getOptions is not a function,网上百度一下之后说是版本问题。
然后我又查了一下npm官网,果然在22天之前less-loader发布了8.0.0新版本,很有可能是新版本带来的兼容问题。
解决办法:卸载less-loader,重新下载一个较低的版本,这样就可以正常打包了。
cnpm uninstall less-loader cnpm i -D less-loader@7 // 最新版本为8.0.0,所以重新下载版本7的最新版本
完。
相关文章推荐
- 关于webpack与less-loader的版本匹配问题TypeError: this.getResolve is not a function at Object.loader
- Module build failed: TypeError: this.getResolve is not a function at Object.loader 安装node-sass运行报错
- webpack打包css报错(已解决):UnhandledPromiseRejectionWarning: TypeError: this.getResolve is not a function
- Module build failed: TypeError: this.getResolve is not a function
- Module build failed: 遇到:TypeError: loaderContext.getResolve is not a function
- 海康web视频插件错误:TypeError: c.HWP_GetLocalConfig is not a function
- blucesun 解决npm报错:Module build failed: TypeError: this.getResolve is not a function
- Uncaught (in promise) TypeError: __webpack_require__.i(...) is not a function
- Vue运行less文件报错:Module build failed: TypeError: loaderContext.getResolve is not a function
- Uncaught TypeError: this.canvas.getContext is not a function
- Uncaught TypeError: __webpack_require__.i(...) is not a function
- Module build failed: TypeError: loaderContext.getResolve is not a function
- webpack webpack-core LoadersList TypeError: r.forEach is not a function
- chrome浏览器Uncaught TypeError: object is not a function问题
- Uncaught TypeError: object is not a function
- js中出现错误:Uncaught TypeError: date.getDay is not a function
- chrome浏览器Uncaught TypeError: object is not a function问题解决
- Uncaught TypeError: UE.getEditor is not a function
- TypeError: 'WebElement' object is not iterable
- TypeError: 'builtin_function_or_method' object is not subscriptable 报错解决方法