vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.92k stars 1.19k forks source link

Component error problem #493

Closed anncwb closed 4 years ago

anncwb commented 4 years ago

Version

4.0.0-beta.11

Reproduction link

https://new-issue.vuejs.org/?repo=vuejs/vue-router-next

Steps to reproduce

When the component corresponding to the route reports an error, the error message is intercepted by the router, only the following error message is displayed, and no specific error message is visible. This is very troublesome for debugging

Uncaught (in promise) Error: Couldn't resolve component "default" for the following record with path "/"
    at vue-router.esm-bundler.js:1884

What is expected?

Display specific error message

What is actually happening?

Display routing error information

posva commented 4 years ago

Use the jsfiddle on the new issue page to provide a repro. Thank you

vanoneang commented 3 years ago

Hi @anncwb ,

I meet the same issue, did you resolve it?

anncwb commented 3 years ago

This is actually not a problem with the router. Check whether there is a problem with the corresponding page code

1beb commented 3 years ago

I had a similar error, found that there was a problem with one of the imports in the script section of my component.

fasalir commented 3 years ago

This is actually not a problem with the router. Check whether there is a problem with the corresponding page code

You are right, i forgot to add comma between methods

cosmoarunn commented 2 years ago

How to resolve if this problem persists when I have an additional url segment on the routes ? Eg :

export const routes = [
    { path: '/marketplace.store',  name: 'store.home', component: () => StoreVue },
    { path: '/marketplace.store/products/:slug', name: 'products.show', component: ()=> ShowProductVue },
   . . .

   export const  router = createRouter({
    history: createWebHistory(),
   // base:  '/ecommerce.store',
    routes 
})

and the router on the StoreVue component,

                    <router-link
                        class="block relative h-48 rounded overflow-hidden"
                        :to="{name: 'products.show', params: {slug: product.slug}}"
                    >

I'm working with laravel and vue3 , vue-router 4.x, The first path is working fine, the 'products.show' changes the window location on the address bar correctly but there's nothing changing on the page.

any help would be greatly appreciated. thanks in advance.

EightArmCode commented 2 months ago

Is there a support group for .vue template linting configuration fails?