Important Information:
The Index/Search/Features modules all share the same code structure, with different names. Each module consists of a path, component, name and meta as seen below.
notes/routes/routes.js
import Index from './index'
import Search from './search'
import Features from './features'
export default {
Index,
Search,
Features
}
notes/routes/index.js
import Index from '../components/index'
export default {
name: 'notes.index',
path: '/notes',
component: Index,
meta: {
title: `Manage notes - Sort`,
}
}
router.js
import Vue from 'vue'
import Router from 'vue-router'
import NoteRoutes from '@notes/routes/routes'
Vue.use(Router)
const routes = Array.prototype.concat(
NoteRoutes,
);
const router = new Router({
mode: 'history',
routes
});
When combining all route.js files using the routes.js exporter for each module, an error is encountered:
Uncaught Error: [vue-router] "path" is required in a route configuration.
Despite having paths defined in all routes, importing the route file directly works but not when utilizing the routes.js file. What could be missing in this setup?