Skip to content

Vite Plugin Route file generation does not work while Vite is running on Windows machines #1312

@natejboucher

Description

@natejboucher

Describe the bug

We just implemented router in our application and developers with Mac machines have the code generation feature working while Vite is running, it picks up new files and file changes, like the documentation says (docs)
However developers with Windows machines do not have that feature. The code generation only seems to check the folder when starting or restarting the application.

We use the default configuration for the plugin with the src/routes folder structure. Currently running router-vite-plugin: V1.19.0 and tanstack/react-router: V1.19.1. We tested the most recent release and the bug was still present, but decided to roll back due to known typescript issues.

This also does not work on the kitchen sink examples provided, however it is worth noting that it doesn't work there for Mac users either.

Your Example Website or App

https://tanstack.com/router/latest/docs/framework/react/examples/kitchen-sink-react-query-file-based

Steps to Reproduce the Bug or Issue

  1. Have a Windows machine
  2. Have Tanstack Router in your application with the router-vite-plugin added.
  3. While the app is running, add a file to the routes folder
  4. The code generation feature should not have picked up the change and the file should remain empty, along with no changes to the routeTree
  5. Stop the application and then start it
  6. The code generation should pickup the new file, generate the code and update the routeTree

Expected behavior

The code generation feature should see the new file or file change while Vite is running and run the code generation feature.

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Chrome
  • Version: React Router: 1.19.1 Router Vite Plugin: 1.19.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions