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

Single Fetch: redirects do not strip basename #9586

Open
oxc opened this issue Jun 7, 2024 · 0 comments
Open

Single Fetch: redirects do not strip basename #9586

oxc opened this issue Jun 7, 2024 · 0 comments

Comments

@oxc
Copy link

oxc commented Jun 7, 2024

Reproduction

  1. Go to https://stackblitz.com/edit/remix-run-remix-css5co?file=vite.config.ts
  2. Open the preview in a new Tab (to see the URL changes)
  3. Append /demoBasename to end of the the preview URL to load the root route
  4. Click on the button
  5. Note that the URL contains the demoBasename twice

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 8.66 GB / 15.48 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.12.2 - /usr/local/bin/node
    Yarn: 4.2.2 - /usr/local/bin/yarn
    npm: 10.5.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 122.0.6261.128

Envinfo for some reason does not output the package versions, so here they are:

  resolution: "@remix-run/dev@npm:2.9.2"
  resolution: "@remix-run/express@npm:2.9.2"
  resolution: "@remix-run/node@npm:2.9.2"
  resolution: "@remix-run/react@npm:2.9.2"
  resolution: "@remix-run/router@npm:1.16.1"
  resolution: "@remix-run/serve@npm:2.9.2"
  resolution: "@remix-run/server-runtime@npm:2.9.2"
  resolution: "@remix-run/web-blob@npm:3.1.0"
  resolution: "@remix-run/web-fetch@npm:4.4.2"
  resolution: "@remix-run/web-file@npm:3.1.0"
  resolution: "@remix-run/web-form-data@npm:3.1.0"
  resolution: "@remix-run/web-stream@npm:1.1.0"
  resolution: "vite-node@npm:1.6.0"
  resolution: "vite-tsconfig-paths@npm:4.3.2"
  resolution: "vite@npm:5.2.11"

Used Package Manager

yarn

Expected Behavior

The page should load the route at /demoBasename/demo and show "It works!"

Actual Behavior

The page tries to load /demoBasename/demoBasename/demo and shows a 404 error.

Possibly related code

Perhaps this line could use a stripBasename? Or use X-Remix-Redirect header?

redirect: headers.get("Location")!,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants