fix: update routes graph when new file is created#2125
Conversation
🦋 Changeset detectedLatest commit: 01b5505 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for solid-start-landing-page ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
There was a problem hiding this comment.
Pull request overview
Fixes dev-server route hot-reload behavior so newly created filesystem routes trigger the correct Vite environment/module graph invalidation (SSR environment is ssr, not server).
Changes:
- Switch route reload invalidation to use
server.environments.ssr(viaVITE_ENVIRONMENTS.server) for SSR. - Replace deprecated
server.moduleGraphusage withserver.environments.client.moduleGraph. - Send a
full-reloadmessage via the selected environment hot channel after invalidation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When in devserver, hot-reload would not catch newly created routes. Existing routes would work fine because Vite would handle the client-side HMR. But on new routes, we need to reload the devserver for ssr
Problem: FS Watcher used
server.environments.serverbut the SSR environment is namedssrserver.environments.server=>server.environments.ssr(actual fix)server.moduleGraph(Vite 5 API) withserver.environments.client.moduleGraph