There was a strange problem with integrating Laravel5.4 with 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)

Two components can load one error, the possible reason is that the Vue component does not support lazy loading

The workaround is that Laravel 5.4 already supports WebPack

Add to webpack.mix.js

output: {    publicPath: '/'} This configuration will doCopy the code