OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

"TypeError: Failed to fetch dynamically imported module" on Vue/Vite vanilla setup

  • Thread starter Thread starter Fernando H'.'
  • Start date Start date
F

Fernando H'.'

Guest
We have a vanilla Vue/Vite setup and I'm receiving TypeError: Failed to fetch dynamically imported module on sentry logs.

It seems like the errors are correlated in time with new deployment to prod, although I don't have enough data to confirm. It doesn't happen on local and appears only on deployed code.
I've seen some similar questions for react's setups, but none with a satisfactory response.
I've also found a similar question regarding dynamically imported svgs, but our errors happen for full components.

The only place where we use dynamic imported components is on routing:

Code:
export const router = createRouter({
  history: routerHistory,
  strict: true,
  routes: [
    {
      path: '/',
      name: routes.homepage.name,
      component: () => import('@/views/Home.vue'),
      children: [
        {
          path: '/overview',
          name: routes.overview.name,
          component: () => import('@/views/Overview.vue'),
        },
        // other similar routes
      ],
    },
  ],
});

Our deps versions:

Code:
    "vue": "^3.0.9",
    "vue-router": "^4.0.5",
    "vite": "^2.0.5",

Any additional information on this issue and how to debug it would be much appreciated!

<p>We have a vanilla Vue/Vite setup and I'm receiving <code>TypeError: Failed to fetch dynamically imported module</code> on sentry logs.</p>
<p>It seems like the errors are correlated in time with new deployment to prod, although I don't have enough data to confirm. It doesn't happen on local and appears only on deployed code.<br />
I've seen some similar questions for react's setups, but none with a satisfactory response.<br />
I've also found a <a href="https://stackoverflow.com/questions...r-failed-to-fetch-dynamically-imported-module">similar question regarding dynamically imported svgs</a>, but our errors happen for full components.</p>
<p>The only place where we use dynamic imported components is on routing:</p>
<pre class="lang-js prettyprint-override"><code>export const router = createRouter({
history: routerHistory,
strict: true,
routes: [
{
path: '/',
name: routes.homepage.name,
component: () => import('@/views/Home.vue'),
children: [
{
path: '/overview',
name: routes.overview.name,
component: () => import('@/views/Overview.vue'),
},
// other similar routes
],
},
],
});
</code></pre>
<p>Our deps versions:</p>
<pre class="lang-js prettyprint-override"><code> "vue": "^3.0.9",
"vue-router": "^4.0.5",
"vite": "^2.0.5",
</code></pre>
<p>Any additional information on this issue and how to debug it would be much appreciated!</p>
 

Online statistics

Members online
0
Guests online
4
Total visitors
4
Top