Closed mkvlrn closed 8 months ago
@mkvlrn Nothing seems unusual, could you please create a StackBlitz project based on this example?
@mkvlrn Nothing seems unusual, could you please create a StackBlitz project based on this example?
It took me a long time to get back to this, I'm sorry. Was AFK for a bit.
I just created it with my current repo: https://stackblitz.com/~/github.com/mkvlrn/ts-react
Updated a few dependencies but the result is still the same. I think it has something to do with how I configured Vite (like I said, didn't use the cli) and I have a root
property set in my configuration. Mostly because I wanted to have index.html
inside src.
@mkvlrn I've found that it's not a routing issue mainly, but the Vite config for the nested index.html
entry is causing an issue with the routes scanning and rendering.
I'd suggest to follow Vite's entry file convention. In order to get the example to work, I moved the index.html
in the project root instead of src/index.html
and updated the script
tag <script type="module" src="/src/index.tsx"></script>
then removed the root: './src',
from Vite config.
not opening as a bug because it's probably something I've done with my configuration, since I have not creted my project using vite, but did it from scratch and added vite and configured it manually.
versions
vite.config.ts
src/index.tsx (that is loaded in src/index.html with
<script type="module" src="index.tsx"></script>
)src/pages/index.tsx
when running vite devserver it shows that generouted scanned 1 route, I'm assuming it's the only page I've got there![image](https://github.com/oedotme/generouted/assets/6718750/b9aa0a34-0b3f-4b66-a756-8fa7cddadb44)
but when opening the dev server at localhost:3000, I got a blank page not even errors thrown in console.
i haven't used crete vite app or similar stuff in a while, but i've compared my configuration to what's being created when using the cli, and it's just about the same. also this is a
type: "module"
project, but that probably won't affect the usage of this plugin, right?does this give out any immediate errors in configuration or usage i may have ignored?