Skip to content

Comments

fix(docs): new Request() will not work without a host#21709

Open
cyco130 wants to merge 1 commit intovitejs:mainfrom
cyco130:patch-1
Open

fix(docs): new Request() will not work without a host#21709
cyco130 wants to merge 1 commit intovitejs:mainfrom
cyco130:patch-1

Conversation

@cyco130
Copy link
Contributor

@cyco130 cyco130 commented Feb 25, 2026

The FetchableDevEnvironment examples in the docs use bare URLs with the Request constructor like new Request('/request-to-handle') but in Node, this constructor requires a full URL with a host, otherwise a TypeError: Failed to parse URL from /request-to-handle will be thrown.

But this is not a complete fix, we need to explain where the HOST_NAME constant will come from and what it should contain. If we don't care about the actual host, a simple http://example.com will work but it would be confusing and require some explanation at least.

Opening this PR to start the discussion.

The examples in the docs use bare URLs with the `Request` constructor like `new Request('/request-to-handle')` but in Node, this constructor requires a full URL with a host, otherwise a `TypeError: Failed to parse URL from /request-to-handle` will be thrown.

But this is not a complete fix, we need to explain where the `HOST_NAME` constant will come from and what it should contain.

Opening this PR to start the discussion.
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

Successfully merging this pull request may close these issues.

1 participant