vue打包时报错提示

(node:8544) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing insi
de of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To termina
te 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:8544) [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.

根据上面提示显示 可能是没有catch()导致报错 所以在请求后面加上catch块
但是根据我的测试 加上catch之后还是不行

最后发现只要注释webpack.prod.conf.js文件中这串代码就可以了

new OptimizeCSSPlugin({
      cssProcessorOptions: config.build.productionSourceMap
        ? { safe: true, map: { inline: false } }
        : { safe: true }
    }),

在这里插入图片描述

Logo

前往低代码交流专区

更多推荐