小言_互联网的博客

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

716人阅读  评论(0)

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

转载:https://blog.csdn.net/qq_45914170/article/details/112338157
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场