-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Open
Labels
Description
Reproduction
https://github.com/richardscarrott/react-router-https-url-bug
- Clone https://github.com/richardscarrott/react-router-https-url-bug (I couldn't get https working directly on StackBlitz)
npm run dev- Visit https://localhost:5173/
- Accept warning (I'm using @vitejs/plugin-basic-ssl which generates untrusted certs)
EXPECT: request.url to be https://localhost:5173/
ACTUAL: request.url is https://undefined/
Original Repro Steps
Create a new project using create-react-router@latest.
Add the following to the vite.config.ts
server: {
https: {
pfx: [path] // cert and key can also be used
},
port: 8001 // optional
}
Add the following loader to the home route
export function loader({ request }: Route.LoaderArgs) {
console.log(request.url);
return {};
}
The output is "http://undefined".
System Info
System:
OS: Windows 11 10.0.22631
CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700
Memory: 15.20 GB / 31.71 GB
Binaries:
Node: 22.17.1 - C:\nvm4w\nodejs\node.EXE
npm: 10.9.2 - C:\nvm4w\nodejs\npm.CMD
Browsers:
Edge: Chromium (134.0.3124.51)
Internet Explorer: 11.0.22621.3527Used Package Manager
npm
Expected Behavior
The request.url should be "https://localhost:8001".
Note: Host and Referer headers have the expected values.
Actual Behavior
The request.url is "http://undefined".