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
genetic-orange•6mo ago
yes, this is expected. you dont import
createFileRoute anymore
this will be much smoother soondeep-jadeOP•6mo ago
Thanks, how do we deal with the TypeScript part then? Create a global or something?
genetic-orange•6mo ago
it's done for you automatically
no need to worry about that
deep-jadeOP•6mo 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 existedgenetic-orange•6mo ago
we only prefill empty files
so you would need to add the export yourself. should be picked up then .
deep-jadeOP•6mo ago
Fair enough, thanks!
genetic-orange•6mo ago
however the code generator is currently being rewritten by me to me much more robust.
will be out soon
deep-jadeOP•6mo ago
Nice! Looking forward to it
Thanks for the help