TypeError: Failed to fetch dynamically imported module:

vue3 + vite bug:

TypeError: Failed to fetch dynamically imported module: 

After checking, I learned that the absolute path import component in vue3 + vite is a little different from vue2 + webpack

Vue3 + vite import method: 

Route import: component: () => import('/src/views/login.vue')}

Component import: import Top from '/src/views/home/top.vue'

Vue2 + webpack import method

component: () =>import('@/views/login')

Relative paths are unchanged: 

component: () => import('../views/login.vue')

Guess you like

Origin blog.csdn.net/m0_50080847/article/details/127360409