VUE使用sass提示在sass文件中提示Syntax Error : this.getOptions is not a function


首先说明,这种问题,90%都是版本问题,需查找刚刚安装了什么插件,用的版本是什么。最好可以对比以前可以用的版本。

本项目:vue 2.6.11  @vue/cli 4.5

安装sass支持  npm install sass sass-loader -D

编译项目出错:

 INFO  Starting development server...
98% after emitting CopyPlugin
 
 ERROR  Failed to compile with 1 error                                                                                                                                                                12:44:01 AM
 
 error  in ./src/App.vue?vue&type=style&index=0&lang=scss&
 
Syntax Error: TypeError: this.getOptions is not a function
 
 
 @ ./node_modules/vue-style-loader??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--8-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=style&index=0&lang=scss& 4:14-416 15:3-20:5 16:22-424
 @ ./src/App.vue?vue&type=style&index=0&lang=scss&
 @ ./src/App.vue
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.1.3:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

降低sass版本:

npm install sass@1.26.10 sass-loader@10.0.2 -D

再次编译,成功

版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
YES开发框架
上一篇:npm运行多个server npm-run-all通知执行多个任务
下一篇:新建vue项目出现error Unexpected ‘debugger‘ statement no-debugger
评论列表

发表评论

评论内容
昵称:
关联文章

VUE使用sass提示sass文件提示Syntax Error : this.getOptions is not a function
.NET Core使用编码GB2312报错‘GB2312‘ is not a supported encoding name 解决方案
Visual Studio (VS) 使用Gulp报错 ReferenceError: primordials is not defined
新建vue项目出现error Unexpected ‘debugger‘ statement no-debugger
cshtml文件使用预编译语法
Quartz.NET使用
VUE Cli3项目添加LESS支持
ASP.NET Core MVC 过滤器ActionFilter保存页面的生成的html静态页面文件
.netcore 打开SQLite数据库失败:You need to call SQLitePCL.raw.SetProvider(). If you are using a bundle package, this is done by calling SQLitePCL.Batteries.Init().”
VUE qiankun
EF MySQL取值时出错: Specified cast is not valid
ASP.NET Core web API使用Swagger/OpenAPI(Swashbuckle)
vue3+vist 打包空白
vue打包js文件添加hash
Node.js版本不对引起的 构建失败提示throw new ERR_INVALID_CALLBACK();
vue结合qiankun无法使用vue devtools调试子项目
Winform项目和Web API的.NetCore项目使用Serilog 来记录日志信息
编译项目提示报错,提示:无法将文件 "**"复制到***,正由另一进程使用,因此该进程无法访问此文件
vue vue-clie多环境配置
asp.net - ASP.NET Core MVC 嵌套 TagHelper

联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码