使用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
}

相关文章:

  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2021-07-28
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-07
  • 2022-12-23
  • 2021-06-27
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
相关资源
相似解决方案