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

URL containing space fails to be fetched during prerender phase #55655

Closed
lukasmatta opened this issue May 3, 2024 · 2 comments
Closed

URL containing space fails to be fetched during prerender phase #55655

lukasmatta opened this issue May 3, 2024 · 2 comments

Comments

@lukasmatta
Copy link
Contributor

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.

How to reproduce:
Clone https://github.com/lukasmatta/prerenderingproblem
Run npm install then run npm 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

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)

Angular CLI: 17.3.6
Node: 18.20.1
Package Manager: npm 10.5.0
OS: darwin arm64

Angular: 17.3.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.6
@angular-devkit/build-angular   17.3.6
@angular-devkit/core            17.3.6
@angular-devkit/schematics      17.3.6
@angular/cli                    17.3.6
@angular/ssr                    17.3.6
@schematics/angular             17.3.6
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.5

Anything else?

No response

@lukasmatta
Copy link
Contributor Author

Transfered to angular-cli angular/angular-cli#27590

@lukasmatta lukasmatta closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant