Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gavry opened this issue Jan 24, 2025 · 0 comments
Open

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

gavry opened this issue Jan 24, 2025 · 0 comments

Comments

@gavry
Copy link

gavry commented Jan 24, 2025

I receive this error from the prod server:

app serve: Server running on http://0.0.0.0:8080
app serve:  [one] Error handling request: TypeError: Cannot read properties of undefined (reading 'cleanPath')
app serve:     at Object.handlePage (file:///workspaces/project/node_modules/one/dist/esm/server/oneServe.mjs:89:74)
app serve:     at file:///workspaces/project/node_modules/one/dist/esm/createHandleRequest.mjs:82:112
app serve:     at runMiddlewares (file:///workspaces/project/node_modules/one/dist/esm/createHandleRequest.mjs:9:42)
app serve:     at file:///workspaces/project/node_modules/one/dist/esm/createHandleRequest.mjs:82:44
app serve:     at file:///workspaces/project/node_modules/one/dist/esm/vite/resolveResponse.mjs:7:32
app serve:     at file:///workspaces/project/node_modules/one/dist/esm/vite/one-server-only.mjs:22:17
app serve:     at AsyncLocalStorage.run (node:async_hooks:346:14)
app serve:     at runWithAsyncLocalContext (file:///workspaces/project/node_modules/one/dist/esm/vite/one-server-only.mjs:21:42)
app serve:     at file:///workspaces/project/node_modules/one/dist/esm/vite/resolveResponse.mjs:5:5
app serve:     at new Promise (<anonymous>)

I'm using:

  • Bun (1.1.43)
  • Node (v20.18.1)
  • one (1.1.411)
  • SSR as the default render mode

My file structure is like this:

app/
    _layout.tsx
    home/
        _layout.tsx
        index+ssg.tsx
        search/
            _layout.tsx
            [query].tsx

The app-level _layout I've left there the whole time. For the other 2, I think it works fine when any of:

  • both _layout files are present
  • both _layout files are gone
  • the layout is only present in search

But it breaks when:

  • the layout is only present in /home, but not in /search.

I'm reasonably sure that this occurs with SPA-mode as well, but can double check! I would guess there's a central cause, but obviously I don't know.

I also have run into the same logged issue with a bunch of different combinations of file structures, including using (core) or [query] as folders. They've all worked completely fine in development, but then certain routes would break. And, most of the routes still work in prod. This is just the first time I nailed it down to one finite change that broke it! Happy to try to help, but I'm not exactly sure where it's best to start!

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

No branches or pull requests

1 participant