You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Goal: Pre-render a larger dataset as a pre-rendered API route, which can be used in a dynamic layout.
In the following structure the pre-rendered /api/global_container is reachable via the URL and working properly.
In the +layout.server.ts the /api/global_container is called and the [...path] catches this route while it should first be catched by the pre-rendered API route.
We tried several work-arounds, with folder structures, when the wildcard [...path] is removed the /api/global_container is reachable and everything works fine as expected. Also when we don't use the internal fetch and call http://localhost:4173/api/global_container than everything works as expected.
Also if I pre-render the root +layout.server.ts than it seems to work fine, but than I have the issue that all data collected in the layout.server.ts is pre-rendered.
Describe the bug
Goal: Pre-render a larger dataset as a pre-rendered API route, which can be used in a dynamic layout.
In the following structure the pre-rendered /api/global_container is reachable via the URL and working properly.
In the +layout.server.ts the /api/global_container is called and the [...path] catches this route while it should first be catched by the pre-rendered API route.
We tried several work-arounds, with folder structures, when the wildcard [...path] is removed the /api/global_container is reachable and everything works fine as expected. Also when we don't use the internal fetch and call http://localhost:4173/api/global_container than everything works as expected.
Also if I pre-render the root +layout.server.ts than it seems to work fine, but than I have the issue that all data collected in the layout.server.ts is pre-rendered.
Reproduction
If you have this structure and only prerender:
![image](https://private-user-images.githubusercontent.com/121555242/309245495-9ab6e502-e960-41ca-90ab-173b3eb865e4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjQ0NDksIm5iZiI6MTczOTI2NDE0OSwicGF0aCI6Ii8xMjE1NTUyNDIvMzA5MjQ1NDk1LTlhYjZlNTAyLWU5NjAtNDFjYS05MGFiLTE3M2IzZWI4NjVlNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQwODU1NDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kZmQzNjcxZDVmODFiMjk4MTViMzcxNmJkNDE0ZWY0MjVmYjA0NjFjMDlhNGZhNDM3ZDJlY2UyOGJlZWM2Mzk4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.wR9QZ1t-d4jlrml_ZjPWIRtHjBDWuPtN5sej_SwWBFI)
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
These calls are template related (header, footer data)
The text was updated successfully, but these errors were encountered: