TypeError: this.getOptions is not a function
报错信息:
Failed to compile. ./node_modules/submodule/components/button/index.vue?vue&type=style&index=0&id=5f075d98&lang=less (./node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!./node_modules/vue-loader-v16/dist/stylePostLoader.js!./node_modules/postcss-loader/src??ref--10-oneOf-1-2!./node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./node_modules/submodule/components/button/index.vue?vue&type=style&index=0&id=5f075d98&lang=less) Module build failed (from ./node_modules/less-loader/dist/cjs.js): TypeError: this.getOptions is not a function at Object.lessLoader (G:\Code\test-submodule\node_modules\less-loader\dist\index.js:21:24)
截图:
解决方案:
步骤一:卸载当前安装的less-loader npm uninstall less-loader 步骤二:安装七点几的版本 npm i less-loader@7.x