-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Discussed in #6146
Originally posted by busy-dog December 19, 2025
Description of the Issue
staticFunctionMiddleware defaults to mounting __tsr/staticServerFnCache at the root path /__tsr/...
Even if base or basePath is set in SSR or Router configuration, the URLs generated by the middleware still access from the root path, leading to 404 errors when accessing resources.
Reproduction Steps
Configure vite.config.ts, set base: '/docs/', and deploy to Ng with corresponding resource routing configured.
Open the browser and navigate to any route. The chromedevtools network shows /__tsr/staticServerFnCache/xxx.json 404.
Expected behavior
The actual request should be to /docs/__tsr/staticServerFnCache/xxx.json
Possible Solution
Add a parameter to the getStaticCacheUrl method in the staticFunctionMiddleware.ts file of start-static-server-functions, or try reading the basePath to correct the fetch url