defineAsyncComponent: After the project is deployed, a "404" problem occurs with dynamic component requests #10033
Unanswered
a1309632272
asked this question in
Help/Questions
Replies: 1 comment
-
That seems like a problem with your build setup. What should have happened is that the build system parsed your code during bundling, and created pure JS bundles for all the possible components that would match that path. The fact that your production bundle requests a .vue file shows that this process did not happen / did not work correctly. I think one possible reason is that you include the file extension in the dynamic string. try this: () => import(`../..views/${action.modalCfg.src}.vue` ) // make sure action.modalCfg.src itself does not contain ".vue" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. I am having some problems with dynamic component mounting using 'defineAsyncComponent'. The code is below. It works fine when the component is started locally, but when the package is deployed to the server, the browser loads the request path with a "404 error ".

components[action.actionId] = defineAsyncComponent( () => import(
../../views/${action.modalCfg.src}) );
Beta Was this translation helpful? Give feedback.
All reactions