zoukankan      html  css  js  c++  java
  • vue 使用webpack 打包 出现UnhandledPromiseRejectionWarning: Error: "dependency" is not a valid chunk sort mode at HtmlWebpackPlugin.sortEntryChunks

      具体错误如下

    building for production...(node:12444) UnhandledPromiseRejectionWarning: Error: "dependency" is not a valid chunk sort mode
        at HtmlWebpackPlugin.sortEntryChunks (D:Desktopennvenue
    ode_moduleshtml-webpack-pluginindex.js:488:11)
        at compiler.hooks.emit.tapAsync (D:Desktopennvenue
    ode_moduleshtml-webpack-pluginindex.js:178:39)
        at AsyncSeriesHook.eval [as callAsync] (eval at create (D:Desktopennvenue
    ode_moduleswebpack
    ode_modules	apablelibHookCodeFactory.js:32:10), <anonymou
    s>:7:1)
        at AsyncSeriesHook.lazyCompileHook (D:Desktopennvenue
    ode_moduleswebpack
    ode_modules	apablelibHook.js:154:20)
        at Compiler.emitAssets (D:Desktopennvenue
    ode_moduleswebpacklibCompiler.js:363:19)
        at onCompiled (D:Desktopennvenue
    ode_moduleswebpacklibCompiler.js:231:9)
        at hooks.afterCompile.callAsync.err (D:Desktopennvenue
    ode_moduleswebpacklibCompiler.js:552:14)
        at AsyncSeriesHook.eval [as callAsync] (eval at create (D:Desktopennvenue
    ode_moduleswebpack
    ode_modules	apablelibHookCodeFactory.js:32:10), <anonymou
    s>:6:1)
        at AsyncSeriesHook.lazyCompileHook (D:Desktopennvenue
    ode_moduleswebpack
    ode_modules	apablelibHook.js:154:20)
        at compilation.seal.err (D:Desktopennvenue
    ode_moduleswebpacklibCompiler.js:549:30)
        at AsyncSeriesHook.eval [as callAsync] (eval at create (D:Desktopennvenue
    ode_moduleswebpack
    ode_modules	apablelibHookCodeFactory.js:32:10), <anonymou
    s>:6:1)
        at AsyncSeriesHook.lazyCompileHook (D:Desktopennvenue
    ode_moduleswebpack
    ode_modules	apablelibHook.js:154:20)
        at hooks.optimizeAssets.callAsync.err (D:Desktopennvenue
    ode_moduleswebpacklibCompilation.js:1323:35)
        at AsyncSeriesHook.eval [as callAsync] (eval at create (D:Desktopennvenue
    ode_moduleswebpack
    ode_modules	apablelibHookCodeFactory.js:32:10), <anonymou
    s>:6:1)
        at AsyncSeriesHook.lazyCompileHook (D:Desktopennvenue
    ode_moduleswebpack
    ode_modules	apablelibHook.js:154:20)
        at hooks.optimizeChunkAssets.callAsync.err (D:Desktopennvenue
    ode_moduleswebpacklibCompilation.js:1314:32)
    (node:12444) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch bl
    ock, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
    (node:12444) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the N
    ode.js process with a non-zero exit code.

    这个选项决定了 script 标签的引用顺序。默认有四个选项,'none', 'auto', 'dependency', '{function}'。

    • 'dependency'  按照不同文件的依赖关系来排序。

    • 'auto' 默认值

    • 'none'  

    • {function}  不懂

           'dependency'  按照不同文件的依赖关系来排序  

     改为auto  注销都可以

     

    npm run build 

    打包成功

  • 相关阅读:
    在Windows Server 2008 R2下搭建jsp环境(四)-在测试的过程中可能出现的问题
    在Windows Server 2008 R2下搭建jsp环境(一)-JDK的下载安装
    在Windows Server 2008 R2下搭建jsp环境(二)-mysql的下载安装
    如何去掉word中的回车符??
    打开office时提示错误窗口“向程序发送命令时出现问题”的解决方案
    在Windows Server 2008 R2下搭建jsp环境
    咱们一起来搭建一个FTP服务器
    如何将项目部署到Github
    电脑开机失败提示"用户配置文件服务登录失败"的三种解决办法
    个人作业2
  • 原文地址:https://www.cnblogs.com/thymeleaf/p/10248708.html
Copyright © 2011-2022 走看看