webpack打包css报错(已解决):UnhandledPromiseRejectionWarning: TypeError: this.getResolve is not a function

UnhandledPromiseRejectionWarning: TypeError: this.getResolve is not a function

(node:13936) UnhandledPromiseRejectionWarning: TypeError: this.getResolve is not a function
    at Object.loader (D:\桌面\前端代码\vue\webpack\learnWebpack-01\webpack的配置\node_modules\css-loader\dist\index.js:62:27)
    at LOADER_EXECUTION (D:\桌面\前端代码\vue\webpack\learnWebpack-01\webpack的配置\node_modules\loader-runner\lib\LoaderRunner.js:119:14)
    at runSyncOrAsync (D:\桌面\前端代码\vue\webpack\learnWebpack-01\webpack的配置\node_modules\loader-runner\lib\LoaderRunner.js:120:4)
    at iterateNormalLoaders (D:\桌面\前端代码\vue\webpack\learnWebpack-01\webpack的配置\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (D:\桌面\前端代码\vue\webpack\learnWebpack-01\webpack的配置\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
    at Storage.finished (D:\桌面\前端代码\vue\webpack\learnWebpack-01\webpack的配置\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:40:15)
    at D:\桌面\前端代码\vue\webpack\learnWebpack-01\webpack的配置\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:77:9
    at D:\桌面\前端代码\vue\webpack\learnWebpack-01\webpack的配置\node_modules\graceful-fs\graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:13936) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which
was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13936) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

当时百度答案是千奇百怪的,可是巧了,没一个是适合我的,后面想了一下,我的webpack是3.6.0版本的,可是我安装的css-loader是最新的,难道是版本原因,后面就按照下面版本的的css-loader重新安装了一遍就好了
解决方法:重新安装css-loader和style-loader

npm install css-loader@2.0.2 --save-dev
npm install style-loader@0.23.1 --save-dev
  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 11
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值