Giter Site home page Giter Site logo

Comments (8)

nilshartmann avatar nilshartmann commented on June 2, 2024 1

@SeanCassiere thanks a ton, it's working now 🎉

Happy routing! 🐣

from router.

visualjerk avatar visualjerk commented on June 2, 2024 1

@usmanabdurrehman I experienced the same issue on MacOS. Upgrading vite and @vitejs/plugin-react to the latest version fixed the issue for me.

from router.

nilshartmann avatar nilshartmann commented on June 2, 2024

I have the same problem on MacOS. It also appears if a route file is renamed, in the renamed file the path to createFileRoute is not updated (and not "Regenerating routes..." message on console).

I tried several ways and that's what i found (MacOS, Router Vite Plugin 1.19.6). In general it seems, the generator does not run on created or removed but only on modified files:

Inside your route folder:

  • touch a new file (in my test it's zsh): touch hello.tsx -> generator does not run
  • touch the same file again: touch hello.tsx -> generator does run

That also seems to work for files that have been added in between

  • touch a.tsx   # NOT run
    touch b.tsx  # NOT run
    touch c.tsx  # NOT run
    
    # touch one of the new routes again
    touch a.tsx # Routes for a, b AND c _are_ all generated at once

Removing files: given a.tsx and b.tsx are existing route files, for that the generator already had been run before:

  • rm a.tsx   # NOT run
    touch b.tsx  # run, updates routeTree.gen.ts and removes /a

Hope that helps. Please let me know if there is anything I can do to help you.

from router.

SeanCassiere avatar SeanCassiere commented on June 2, 2024

I made some changes to the hook that our vite plugin was using to watch for changes. It went out with release 1.24.1.

@natejboucher - could you check if this has made any impact to the experience on Windows?
@nilshartmann - could you also confirm this against your scenarios that you listed?

from router.

SeanCassiere avatar SeanCassiere commented on June 2, 2024

@natejboucher when you have chance, could you confirm if this change made any impact to the Windows experience?

You can download the Router Stackblitz Starter and quickly test it with the latest version of TanStack Router with the Vite Plugin.

from router.

SeanCassiere avatar SeanCassiere commented on June 2, 2024

Closing for now.

@natejboucher if this fix that went out with the release from this comment didn't fix the problem on Windows, please let us know.

from router.

usmanabdurrehman avatar usmanabdurrehman commented on June 2, 2024

@SeanCassiere This problem still exists on windows. I am using @tanstack/router-vite-plugin ^1.28.2 which is the latest version rn. Routes only get updated in routeTree.gen.ts when we restart the server. Link for example project if you want to test on a windows VM https://github.com/usmanabdurrehman/tanstack-router-tutorials

from router.

usmanabdurrehman avatar usmanabdurrehman commented on June 2, 2024

@visualjerk 😭 man. Thank you so much. I thought when making apps with vite it would automatically install the latest vite versions but it was way behind. Thanks for the help 👍

from router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.