Route file does not export any route piece
Sandbox: https://stackblitz.com/edit/vitejs-vite-hc6bcytw
I created a new React project using Tanstack Router. This is the Vite configuration
Next I created a router.ts
and imported it in the main file
Inside the routes folder I added a root layout and a index.tsx file
When running the app I see the following "error"
Now the index.tsx file also shows the error
and the routeTree.gen.ts file remains empty.
What is wrong or missing?
I created a new React project using Tanstack Router. This is the Vite configuration
Next I created a router.ts
and imported it in the main file
Inside the routes folder I added a root layout and a index.tsx file
When running the app I see the following "error"
Route file "import { createFileRoute } from '@tanstack/react-router';
const Route = createFileRoute('/')({
component: Page,
});
function Page() {
return <div>React Starter</div>;
}
export { Route };
" does not export any route piece. This is likely a mistake.
Generated route tree in 450ms
Now the index.tsx file also shows the error
Argument of type '"/"' is not assignable to parameter of type 'undefined'.(2345)
and the routeTree.gen.ts file remains empty.
What is wrong or missing?