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

Redirect fails with 1.8.0 on Cloudflare #4740

Closed
assaf opened this issue Dec 2, 2022 · 12 comments
Closed

Redirect fails with 1.8.0 on Cloudflare #4740

assaf opened this issue Dec 2, 2022 · 12 comments
Labels
bug Something isn't working feat:routing

Comments

@assaf
Copy link

assaf commented Dec 2, 2022

What version of Remix are you using?

1.8.0

Steps to Reproduce

I'm getting TypeError: Invalid URL string errors from any loader or action has have a redirect. This will fail:

export async function loader() {
  return redirect("/");
}

Seeing this when deploying to Cloudflare pages with 1.8.0. No issues in development, or when using 1.7.6.

Expected Behavior

Works fine with 1.7.6.

Actual Behavior

Stack trace I'm getting:

TypeError: Invalid URL string.
    at ks (worker.mjs:553:10)
    at k1 (worker.mjs:839:89)
    at async Promise.all (index 0)
    at async l (worker.mjs:799:13)
    at async a (worker.mjs:750:15)
    at async Object.i [as queryRoute] (worker.mjs:736:13)
    at async FL (worker.mjs:1828:13)
    at async worker.mjs:1878:65
    at async o (worker.mjs:12998:22)
    at async worker.mjs:13002:14
@brophdawg11
Copy link
Contributor

Thanks @assaf! We found the issue here and will get a patch out next week with a fix 👍

@brophdawg11 brophdawg11 self-assigned this Dec 2, 2022
@brophdawg11 brophdawg11 added bug Something isn't working feat:routing and removed bug:unverified labels Dec 2, 2022
@tulup-conner
Copy link

Wow, I spent the past two days beating myself up over this. Thank you for bringing me sanity. Downgrading to previous remix version again..

@JulienMelissas
Copy link

Haha, I also should have probably looked to see if this was a bug or if I was just crazy. Thank you for already being on this! 🎉

@tulup-conner
Copy link

tulup-conner commented Dec 5, 2022

I upgraded to 1.8.1 on Cloudflare Pages and I still receive the Unexpected Server Error warning on redirects (in other words, the TypeError: Invalid URL string fun)

@brophdawg11
Copy link
Contributor

Hey folks - this fix wasn't in 1.8.1 :). The merged PR above is over in @remix-run/router which is in pre-release and we'll be testing that updated dependency in Remix today and prepping a 1.8.2 with any other router changes.

@brophdawg11
Copy link
Contributor

👋 We just released the fix for this in a prerelease (1.8.2-pre.0). Feel free to give that a run and let us know if it solves this for you!

@brophdawg11 brophdawg11 added the awaiting release This issue has been fixed and will be released soon label Dec 6, 2022
@JulienMelissas
Copy link

Thanks @brophdawg11, I looked at the documentation for upgrade instructions, but didn't see anything. Should we be updating @remix-run/cloudflare, @remix-run/cloudflare-pages, or @remix-run/react (or a combination/all 3) to that version? Thank you!

@brandonpittman
Copy link

@JulienMelissas I believe that running a mix of versions would cause issues.

@machour
Copy link
Collaborator

machour commented Dec 7, 2022

@JulienMelissas you should always update all your remix packages to the same version

@brophdawg11
Copy link
Contributor

This is released in 1.8.2 👍

@JulienMelissas
Copy link

Just confirming upgrading to 1.8.2 fixed it for me, thanks much for the quick fix, sorry I wasn't able to check the fix sooner.

@assaf
Copy link
Author

assaf commented Dec 9, 2022

Thanks for fixing this!

@brophdawg11 brophdawg11 removed the awaiting release This issue has been fixed and will be released soon label Apr 21, 2023
@brophdawg11 brophdawg11 removed their assignment Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feat:routing
Projects
None yet
Development

No branches or pull requests

6 participants