Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
When there is a URL containing space being fetched, it fails during prerendering. Encoding space to be %20 doesn't help. I've tried it with both withFetch() and without it when providing HttpClient.
ERROR TypeError: Failed to parse URL from /assets/Folder%20space/test.txt
at node:internal/deps/undici/undici:12618:11
at a.invoke (file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/polyfills.server.mjs:3:6639)
at Object.onInvoke (file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/chunk-I5RKM5LS.mjs:34:17372)
at a.invoke (file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/polyfills.server.mjs:3:6579)
at p.run (file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/polyfills.server.mjs:3:1965)
at file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/polyfills.server.mjs:4:577
at a.invokeTask (file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/polyfills.server.mjs:3:7265)
at Object.onInvokeTask (file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/chunk-I5RKM5LS.mjs:34:17188)
at a.invokeTask (file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/polyfills.server.mjs:3:7186)
at p.runTask (file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/polyfills.server.mjs:3:2577) {
[cause]: TypeError [ERR_INVALID_URL]: Invalid URL
at new NodeError (node:internal/errors:405:5)
at new URL (node:internal/url:676:13)
at new Request (node:internal/deps/undici/undici:6108:25)
at fetch (node:internal/deps/undici/undici:10396:25)
at Object.fetch (node:internal/deps/undici/undici:12617:10)
at fetch (node:internal/process/pre_execution:281:25)
at patchedFetch (//PrerenderSpaceUrl/node_modules/@angular-devkit/build-angular/src/utils/server-rendering/fetch-patch.js:42:20)
at file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/polyfills.server.mjs:4:3273
at l.<computed> (file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/polyfills.server.mjs:3:12973)
at e.<anonymous> (file:////PrerenderSpaceUrl/.angular/prerender-root/2bfae38a-22b4-47d1-9c2c-0681f0ed977a/chunk-I5RKM5LS.mjs:35:13916) {
input: '/assets/Folder%20space/test.txt',
code: 'ERR_INVALID_URL'
}
}
Please provide the environment you discovered this bug in (run ng version)
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
When there is a URL containing space being fetched, it fails during prerendering. Encoding space to be
%20
doesn't help. I've tried it with bothwithFetch()
and without it when providingHttpClient
.How to reproduce: Clone https://github.com/lukasmatta/prerenderingproblem Run
npm install
then runnpm build
Please provide a link to a minimal reproduction of the bug
https://github.com/lukasmatta/prerenderingproblem
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response