在整合laravel5.4 和vue2.1的时候遇到一个奇怪的问题

Uncaught SyntaxError: Unexpected token <
Error: Loading chunk 0 failed.
at HTMLScriptElement.onScriptComplete (app.js:99)
[vue-router] Failed to resolve async component default: Error: Loading chunk 0 failed.
Error: Loading chunk 0 failed.
at HTMLScriptElement.onScriptComplete (app.js:99)

两个组件 一个能加载  一个报错,可能原因是不支持延迟加载Vue组件

解决方法是 laravel 5.4已经支持webpack

在 webpack.mix.js 中加上

output: {
publicPath: '/'
}
这个配置就可以了

[vue-router] Failed to resolve async component default: Error: Loading chunk 0 failed.的更多相关文章

  1. 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 chu ...

  2. 解决IE报错[vue router]Failed to resolve async component default:strict 模式下不允许分配到只读属性

    之前遇到过一个奇怪的问题,在其他浏览器下一切正常,但在万恶的IE下,却一直不行. 具体问题场景就是:比如orderDetail页面出现问题,那么只要是路由跳转的,点第1次无法跳转,必须得点第2次才可以 ...

  3. VUE项目部署到线上生产环境,Loading chunk xxx failed

    项目部署到生产环境,路由点击无效,报错 Loading chunk chunk-xxxxx failed.(missing xxxx) 加载失败,错误的路径. 话不多说,直接贴代码: vue.conf ...

  4. Failed to resolve com.android.support:support-compat:25.4.0

    3down votefavorite   I am trying to include this library to my project by adding compile 'jp.wasabee ...

  5. Vue项目中出现Loading chunk {n} failed问题的解决方法

    最近有个Vue项目中会偶尔出现Loading chunk {n} failed的报错,报错来自于webpack进行code spilt之后某些bundle文件lazy loading失败.但是这个问题 ...

  6. 对于vue项目更新迭代导致上传至服务器后出现Loading chunk {n} failed和Unexpected token <的解决方式

    相信大家对于vue项目的维护与更新中会遇见很多问题,其中有两种情况最为常见. 一种是Loading chunk {n} failed,这种情况出现的原因是vue页面更新上传至服务器后,由于vue默认打 ...

  7. Failed to resolve: com.android.support:design:25.4.0

    韩梦飞沙  韩亚飞  313134555@qq.com  yue31313  han_meng_fei_sha 错误:(27, 13) Failed to resolve: com.android.s ...

  8. Error:(27, 13) Failed to resolve: com.android.support.constraint:constraint-layout:1.0.2约束布局constraint-layout导入失败的解决方案

    运行demo提示错误: Error:(27, 13) Failed to resolve: com.android.support.constraint:constraint-layout:1.0.2 ...

  9. Vue打包后放到服务器出现Loading chunk {n} failed 错误

    导航栏点击切换时 会出现Loading chunk {n} failed  ,刷新之后便不会出现.而且n在最新的build的文件中,n没有存在 偶然一次发现,项目更新迭代开发时上传测试环境后就会出现, ...

随机推荐

  1. 阴影效果的小 demo

    早上没事干,感觉字体阴影的效果还是好看的,那么就来一个小demo吧! 1.这是html 简单的有一个标签或者盒子都可以 <div class="demo11">我爱考试 ...

  2. 【个人训练】(POJ3279)Fliptile

    最近在刷kuangbin神犇的各种套题....感觉自己好弱啊.....还是要多多训练,跟上大神的脚步.最近的这十几题都比较水,记下来这一条我比较印象深刻.也比较难的题目吧(之后应该不会再有水题写了,珍 ...

  3. Markdown常用的几种语法

    在VScode上面写的,现将代码粘贴如下:(在VScode里运行下即可) # Markdown语法 # Ctrl + k v 打开侧边预览 ## 一.加粗斜体删除线 **这是要加粗的文字** *这是要 ...

  4. Python 3.6 爬取BD电影网

    2018-07-10 #coding:utf-8 #coding:utf-8 from lxml import etree import requests import pandas import t ...

  5. Codeforces Round #345 Div.1 D.Zip-line 动态最长上升子序列

    题意概述: 给出一个长度为N的序列和M组询问,问假设把某个位置的值改成另一个给出的值之后,序列的最长上升子序列的长度. N,M<=400000. 分析: 考虑某个位置的值改动后这个位置和最长上升 ...

  6. PHP中的6种加密方式

    PHP中的6种加密方式 1. MD5加密 string md5 ( string $str [, bool $raw_output = false ] ) 参数 str  --  原始字符串. raw ...

  7. Win7下搭建Zigbee开发环境

    操作系统:64位Win7 芯片类型:Texas Instruments的CC2530 软件平台:IAR v8.10 Zigbee协议栈:ZStack-CC2530-2.5.1a CP2102 USB ...

  8. Understand:高效代码静态分析神器详解(一) | 墨香博客 http://www.codemx.cn/2016/04/30/Understand01/

    Understand:高效代码静态分析神器详解(一) | 墨香博客 http://www.codemx.cn/2016/04/30/Understand01/ ===== 之前用Windows系统,一 ...

  9. postman工具【接口自动化测试关于断言】

    在使用postman工具进行接口自动化时我们经常需要断言来进行判断,结果到底是成功还是失败. 但在collection runner/Newman里如果不加断言,跑完后都无法知道是成功还是失败 断言是 ...

  10. LTE QOS

    http://wenku.baidu.com/link?url=ziFIkdKaC7MU2RY-bTOp2bt87WFPw5_02bqmYs5W6w4ktOfPHEcWesK1U2T7YiyXjVSM ...