vuejs / vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
http://v2.vuejs.org
MIT License
207.99k stars 33.69k forks source link

[Vue warn]: Unknown custom element: <router-view> - did you register the component correctly? For recursive components, make sure to provide the "name" option. #7618

Closed dtahir57 closed 6 years ago

dtahir57 commented 6 years ago

https://new-issue.vuejs.org/

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

here is my app.js file

require('./bootstrap'); window.Vue = require('vue');

import Vue from 'vue' import VueRouter from 'vue-router' Vue.use('VueRouter');

import Sidebar from './components/Sidebar' import Dashboard from './components/Dashboard' import Transactions from './components/Transactions'

const routes = [ { name: 'Dashboard', path: '/dashboard', component: Dashboard }, { name: 'Transactions', path: '/transactions', component: Transactions } ]

const router = new VueRouter({ routes, mode: 'history' })

//Vue.component('side-bar', require('./components/Sidebar.vue'));

const app = new Vue({ el: '#app', router, components: { 'side-bar': Sidebar } });

Here is the Sidebar.vue , this is the file which is not rendering vue-link tag into a tag

Please help me out, Its been 24 hours , I am stuck at this basic stuff. I'm using Laravel 5.5

Here is the package.json file , in case if anybody also wants to see this.

{ "private": true, "scripts": { "dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch-poll": "npm run watch -- --watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { "axios": "^0.17", "bootstrap": "^4.0.0", "popper.js": "^1.12", "cross-env": "^5.1", "jquery": "^3.2", "laravel-mix": "^2.0", "lodash": "^4.17.4", "vue": "^2.5.7" }, "dependencies": { "vue-router": "^3.0.1" } }

vue-bot commented 6 years ago

Hello, your issue has been closed because it does not conform to our issue requirements. In order to ensure every issue provides the necessary information for us to investigate, we require the use of the Issue Helper when creating new issues. Thank you!


你好,你的 issue 不符合我们所要求的格式,因此已被自动关闭。为了确保每个 issue 都提供必需的相关信息,请务必使用我们的 Issue 向导 来创建新 issue,谢谢!

LinusBorg commented 6 years ago

Thank your for your interest in this project.

However, your issue is a usage/support question, and the issue tracker is reserved exclusively for bug reports and feature requests (as outlined in our Contributing Guide).

We encourage you to ask it on the forum , Stack Overflow or on our Discord chat and are happy to help you out there.