Skip to content

Conversation

@natew
Copy link
Collaborator

@natew natew commented Jan 7, 2026

Summary

  • Adds a fallback mechanism when looking up route build info
  • If the exact file key match fails, tries to find build info by matching the URL pathname or route page to the cleanPath
  • Adds a development warning when buildInfo is not found for spa/ssg routes

Fixes #446 (SSR routes return 404 when layout present only in parent)

Test plan

  • Build a project with parent layout but no child layout
  • Verify routes don't return 404 errors

@railway-app
Copy link

railway-app bot commented Jan 7, 2026

🚅 Deployed to the one-pr-644 environment in onestack.dev

Service Status Web Updated (UTC)
one ✅ Success (View Logs) Web Jan 7, 2026 at 5:11 am

@railway-app railway-app bot temporarily deployed to onestack.dev / one-pr-644 January 7, 2026 02:45 Destroyed
@natew natew force-pushed the fix/ssr-route-buildinfo-lookup branch from bcc6f8f to 811aa16 Compare January 7, 2026 02:54
@railway-app railway-app bot temporarily deployed to onestack.dev / one-pr-644 January 7, 2026 02:54 Destroyed
@natew
Copy link
Collaborator Author

natew commented Jan 7, 2026

Updated to use O(1) pathToRoute lookup instead of for loop iteration. The pathToRoute index is already built at build time, so this is efficient.

Note: This still needs integration tests to properly verify the fix. The test would need to:

  1. Create a test app with parent layout but no child layout
  2. Build the app
  3. Serve and verify routes don't return 404

@railway-app railway-app bot temporarily deployed to onestack.dev / one-pr-644 January 7, 2026 03:08 Destroyed
natew added 3 commits January 6, 2026 18:38
- Fix localhost vs 0.0.0.0 URL comparison in redirect test
- Skip prod tests for test-loaders (pre-existing SSR redirect build issue)
- Remove ssr-nested-layout test (tests route priority, not buildInfo lookup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSR routes return 404 when layout present only in parent

2 participants