remix-run / grunge-stack

The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.
https://remix.run/stacks
MIT License
434 stars 95 forks source link

redirect() for freshly installed grunge stack redirects to <uri>,%20<uri> #190

Open purphoros opened 1 month ago

purphoros commented 1 month ago

Have you experienced this bug with the latest version of the template?

Yes

Steps to Reproduce

$ npx create-remix@latest --template remix-run/grunge-stack

   remix   v2.12.0 💿 Let's build a better website...

   dir   Where should we create your new project?
         ./grunge-stack

      â—¼  Template: Using remix-run/grunge-stack...
      ✔  Template copied

   git   Initialize a new git repository?
         Yes

  deps   Install dependencies with npm?
         Yes

  init   This template has a remix.init script. Do you want to run it?
         Yes

      ✔  Dependencies installed

      ✔  Git initialized
      ✔  Dependencies for remix.init script installed

      â—¼  Running template's remix.init script... 

$ cd ./grunge-stack
$ mv .env.example .env
$ npm run dev

Sign Up will redirect to http://localhost:3333/,%20/ Log In will redirect to http://localhost:3333/notes,%20/notes

I can replicate this in both Windows (Git Bash) and macOS (Silicon).

Using the existing version template npx create-remix@2.11.0 --template remix-run/grunge-stack results in the same issue, as it upgrades all the dependencies to 2.12.0 and beyond.

In this scenario, I manually changed the package.json file versions from ^2.11.0 to 2.11.0 and installed via npm install --legacy-peer-deps, but the result was the same, even though the lock file still contains Remix 2.11.0 dependencies and an older version of @remix-run/router (1.19.0).

I tried with Node 18 and 20.

So, I’m not entirely sure of the root cause.

This is only a local development issue; I deployed to staging, and it’s not an issue there. However, I’ve refrained from deploying to production.

Expected Behavior

Sign Up will redirect to http://localhost:3333/ Log In will redirect to http://localhost:3333/notes

Actual Behavior

Sign Up will redirect to http://localhost:3333/,%20/ Log In will redirect to http://localhost:3333/notes,%20/notes

MosheStauber commented 1 month ago

same here, did you find anything?

purphoros commented 1 month ago

same here, did you find anything?

I'm not sure which dependency is the root cause. I spent a lot of time troubleshooting and once I verified that it wasn't affecting deployments I decided to just work around it (work deadlines).

If you run your build locally npm run build and start in arc sandbox with npm run start the issue will not occur.

It only occurs when running arc sandbox from remix dev, so some dependency between the 2 is conflicting.

I've since done production deployments without any issues.

I'll look more into it when I get some free time.