stef686's avatar

Webpack js version files uri incorrect

The js for my app has stopped loading in the latest version of a js file. This is possibly down to me switching development environments last night!

Gulp runs fine however when running in a browser I get the following error:

File not found: /manage/722/event/5.manage.js

Error: Loading chunk 5 failed. /js/manage.js:130

Obviously, I can see from this the manage.js file is attempting to load 5.manage.js (the latest version) however it's not looking in /js/ for the file, it's appending the current page's URI which in this example is /manage/722/event/.

Is there a config setting somewhere to set the root path?

0 likes
2 replies
stef686's avatar

I've updated to use mix rather than elixir, still receiving the same issue.

Some extra information - I am using vue-router and the issue is causing the uri to be removed in the browser on load. If I load a URL that's not in my routes no error is seen. If I navigate to a routed URL the error appears (no page refresh).

stef686's avatar
stef686
OP
Best Answer
Level 3

Finally solved this issue so posting the solution in case anyone experiences similar. It was to do with the way I was loading the components for each route. I was loading them like so:

const Feed       = (resolve) => require(['./components/manage/Feed.vue'], resolve)

Changing them to the following format resolves the error:

import Feed from './components/manage/Feed.vue'

Please or to participate in this conversation.