Registry / web-framework / generouted

generouted

JSON →
library1.20.2jsnpmunverified

Generouted is a Vite plugin that generates client-side file-based routes from the src/pages directory, supporting React Router, TanStack Router, and Solid Router. Current stable version is 1.20.2, with frequent releases addressing compatibility with Vite 8 and Rolldown. Key differentiators include type-safe navigation, global modals, route-based code-splitting, data loaders/actions, nested layouts, pathless layout groups, and optional static/dynamic routes. It uses Vite's glob import API and provides generated components and hooks for each framework.

npm install generouted
INSTALL
IMPORT
SIG · GENEROUTED
G
generouted
web-frameworkjavascriptv1.20.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18223 runs
build_error
glibc
node 18223 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> }
Debug
Known issues
breakingReact Router integration: upgrade react-router-dom to v7+ and replace with react-router package to avoid version mismatches
fix
npm install react-router@latest && remove react-router-dom
affects: >=1.20.0
gotchaRoutes detection differences between dev and build modes (Vite 8 + Rolldown compatibility)
fix
Update to >=1.20.2
affects: <1.20.2
gotchaUndefined module imports from parent routes can occur
fix
Update to >=1.19.11
affects: <1.19.11
gotchaInternal browser router instantiation issue causing multiple instances
fix
Update to >=1.19.8
affects: <1.19.8
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
fix
Install @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
fix
Import 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
fix
Add 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
fix
Use import { Link } from '@generouted/react-router' instead of from a separate module
Upgrade
Version history
1.20.2latest on npm
Audit
Dependencies
viterequiredRequired peer dependency for Vite plugin functionality
Agent activity
2 hits · last 30 days
node
2
Resources
generouted — npm install generouted · libregistry