Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Routes
✓ import { Routes } from '@generouted/react-router'
✗ import { Routes } from 'generouted'
Package name is scoped under @generouted; main export is the generated Routes component
Link
✓ import { Link } from '@generouted/react-router/link'
✗ import { Link } from 'react-router-dom'
Generouted provides its own Link component for type-safe navigation
useNavigate
✓ import { useNavigate } from '@generouted/react-router'
✗ import { useNavigate } from 'react-router-dom'
Use Generouted's hook to ensure type-safety and correct route resolution
Module
✓ import type { Module } from '@generouted/react-router'
Type import for route module definitions
Simple Vite project setup with Generouted React Router plugin, file-based routes in src/pages, dynamic routes with params
// vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import generouted from '@generouted/react-router/plugin'
export default defineConfig({ plugins: [react(), generouted()] })
// src/main.tsx
import { createRoot } from 'react-dom/client'
import { Routes } from '@generouted/react-router'
createRoot(document.getElementById('root')!).render(<Routes />)
// src/pages/index.tsx
export default function Home() {
return <h1>Hello Generouted!</h1>
}
// src/pages/about.tsx
export default function About() {
return <h1>About</h1>
}
// src/pages/users/[id].tsx (dynamic route)
export default function User({ params }: { params: { id: string } }) {
return <h1>User {params.id}</h1>
}
Errors
Common errors & fixes
Error: Cannot find module '@generouted/react-router' or its corresponding type declarations.
Missing dependency or incorrect import path from scoped package
fixInstall @generouted/react-router: npm install @generouted/react-router react-router
TypeError: Cannot read properties of undefined (reading 'pathname')
Using react-router-dom's useNavigate or Link instead of Generouted's type-safe versions
fixImport useNavigate and Link from '@generouted/react-router' not 'react-router-dom'
Error: @generouted/react-router: Vite plugin not found. Make sure to add generouted() to your vite config.
Vite plugin not configured in vite.config.ts
fixAdd generouted() plugin: import generouted from '@generouted/react-router/plugin' and include in plugins array
Error: [plugin:vite:import-analysis] Failed to resolve import "@generouted/react-router/link"
Incorrect import path; the link module may have been removed or renamed
fixUse import { Link } from '@generouted/react-router' instead of from a separate module Audit
Dependencies
viterequiredRequired peer dependency for Vite plugin functionality