createFileRoute removed on save
Trying to migrate from Next.js, running the alpha. Running into two issues with file based routing:
1. No
createFileRoute
being inserted in existing files
2. With new files, createFileRoute
is added, but when saving the createFileRoute
import is removed
Vite config
8 Replies
foreign-sapphire•3mo ago
yes, this is expected. you dont import
createFileRoute
anymore
this will be much smoother soonapparent-cyanOP•3mo ago
Thanks, how do we deal with the TypeScript part then? Create a global or something?
foreign-sapphire•3mo ago
it's done for you automatically
no need to worry about that
apparent-cyanOP•3mo ago
It seems that this only works for 1 file for me. In my
index.tsx
I dont need the import. In other files it will give me a missing definition error.
Also, is there a way to fix #1? It seems that Vite is not adding export const Route ...
to files that already existedforeign-sapphire•3mo ago
we only prefill empty files
so you would need to add the export yourself. should be picked up then .
apparent-cyanOP•3mo ago
Fair enough, thanks!
foreign-sapphire•3mo ago
however the code generator is currently being rewritten by me to me much more robust.
will be out soon
apparent-cyanOP•3mo ago
Nice! Looking forward to it
Thanks for the help