问题描述
(node:10136) UnhandledPromiseRejectionWarning: TypeError: this.getResolve is not a function
at Object.loader (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\css-loader\dist\index.js:62:27)
at LOADER_EXECUTION (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\loader-runner\lib\LoaderRunner.js:119:14)
at runSyncOrAsync (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\loader-runner\lib\LoaderRunner.js:120:4)
at iterateNormalLoaders (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
at Array. (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:40:15)
at F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:77:9
at F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\graceful-fs\graceful-fs.js:123:16
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
(node:10136) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function wit
hout a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10136) [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.
处理方法
一:修改css-loader中的版本问题,网上解决方法是把8.0版本修改为7.3,我这里把其修改为3.6.0就可以了。
二:运行npm install
三:运行npm run build 成功解决问题。