npm运行/打包项目报错:UnhandledPromiseRejectionWarning: TypeError: loaderContext.getResolve is not a function
使用的是stylus/less/sass这项技术,不过在安装stylus/less/sass后,运行vue项目后报错:UnhandledPromiseRejectionWarning: TypeError: loaderContext.getResolve is not a function,查了之后才知道这是由于stylus-loader版本过高
只需要搭配低版本,在项目下根据自己使用的工具输入即可:
yarn add stylus-loader@5.0.0 -D
或者 npm install stylus-loader@5.0.0 -D
或 cnpm install stylus-loader@5.0.0 -D 即可解决这个问题