Я недавно обновил свой следующий Js проект до версии 9. Я использую пакет next-маршруты с экспортом как дно.
const routes = require('next-routes');
module.exports = routes()
//******************************** structure of routes => {nameOfRoute, pattern of route, page name inside pages folder } ************
.add('homepage', '/', 'index')
// **************************** Profile routes *******************************************************
.add('dashboard', '/dashboard', 'dashboard/index')
.add('profile_navigation', '/dashboard/profile/navigation', 'dashboard/profile/navigation')
.add('profile_userInfo', '/dashboard/profile/user-information', 'dashboard/profile/userInfo')
.add('profile_education', '/dashboard/profile/education', 'dashboard/profile/education')
.add('profile_sendCV', '/dashboard/profile/send-cv', 'dashboard/profile/sendCV')
.add('profile_skills', '/dashboard/profile/skills', 'dashboard/profile/skills')
.add('profile_honorAndResearch', '/dashboard/profile/honor-and-research', 'dashboard/profile/honorAndResearch')
.add('profile_language', '/dashboard/profile/language-skill', 'dashboard/profile/language')
.add('profile_workExperience', '/dashboard/profile/work-experience', 'dashboard/profile/workExperience')
.add('profile_profilePreview', '/dashboard/profile/preview', 'dashboard/profile/profileView')
.add('profile_favoriteJobs', '/dashboard/profile/favorite-jobs', 'dashboard/profile/favoriteJobs')
.add('profile_courses', '/dashboard/profile/courses', 'dashboard/profile/courses')
Возникает проблема при использовании Ссылка вот так
import { Link } from '../../routes';
<Link route="dashboard">
<a>Some text</a>
</Link>
Я получаю ошибку
Uncaught TypeError: Parameter 'url' must be a string, not undefined
at Url.push../node_modules/url/url.js.Url.parse (url.js:112)
at urlParse (url.js:106)
at Url.push../node_modules/url/url.js.Url.resolve (url.js:443)
at urlResolve (url.js:439)
at Link.getHref (link.js:8)
at Link.handleRef (link.js:8)
at ref (link.js:13)