Vue-cli3.x在開發環境中(router采用 history模式)出現Failed to resolve async component default: Error: Loading chunk {/d} failed.或者Uncaught SyntaxError: Unexpected token <錯誤


使用Vue-cli3.x開發環境中(router采用 history模式)出現Failed to resolve async component default: Error: Loading chunk {/d} failed.或者Uncaught SyntaxError: Unexpected token <錯誤

錯誤截圖

解決方案

修改webpack的配置,
在vue.config.js文件中修改publicPath為'/'即解決問題

module.exports = {
  publicPath: '/', // <----這里就是會修改webpack的outPath.publicPath
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM