gpt4 book ai didi

javascript - 将 scss 加载到 Vue3 时出错 TypeError : this. getOptions 不是函数

转载 作者:行者123 更新时间:2023-12-05 00:53:37 25 4
gpt4 key购买 nike

我尝试将 scss 文件加载到 Vue3 项目中。

我用:

"@vue/cli": "^4.5.13",
"@vue/cli-service": "^4.5.13",
"@vue/compiler-sfc": "^3.0.11",
"sass": "^1.32.13",
"sass-loader": "^11.1.1",
"vue": "^3.0.11",
"vue-resource": "^1.3.4",
"webpack": "5.0.0"

我还有销售问题:

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
TypeError: this.getOptions is not a function
at Object.loader (/home/dev/src/my-app/node_modules/sass-loader/dist/index.js:25:24)

所有都是最新的,我已经删除了我的 node_modules 并重新安装了它们。我也删除了 node-sass,所以我只有 sass 包。

最佳答案

我今天也犯了同样的错误

 "dependencies": {
"core-js": "^3.12.1",
"vue": "^3.0.11",
"vuetify": "^2.5.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.13",
"@vue/cli-plugin-eslint": "^4.5.13",
"@vue/cli-service": "^4.5.13",
"@vue/compiler-sfc": "^3.0.11",
"babel-eslint": "^10.1.0",
"eslint": "^6.8.0",
"eslint-plugin-vue": "^7.9.0",
"sass": "^1.34.1",
"sass-loader": "^10.1.1",
"vue-loader-v16": "^16.0.0-beta.5.4"
},

从“sass-loader”:“^12.0.0”更改为“sass-loader”:“^10.1.1”

运行:

rm -rf node_modules
rm package-lock.json
npm install

对我来说解决了

关于javascript - 将 scss 加载到 Vue3 时出错 TypeError : this. getOptions 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67623125/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com