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

Remix 1.16 unstable_dev race condition #6286

Closed
1 task done
thinkafterbefore opened this issue May 2, 2023 · 4 comments
Closed
1 task done

Remix 1.16 unstable_dev race condition #6286

thinkafterbefore opened this issue May 2, 2023 · 4 comments

Comments

@thinkafterbefore
Copy link

thinkafterbefore commented May 2, 2023

What version of Remix are you using?

1.16

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

  1. npx create-remix@latest --template https://github.com/remix-run/remix/tree/templates_v2_dev/templates/cloudflare-pages

  2. Replace /app/routes/_index.tsx with

import { json } from "@remix-run/cloudflare";

const DELAY = 1000;

export const loader = async () => {
  await new Promise((resolve) => setTimeout(resolve, DELAY));
  return json(null);
};

export default function Test() {
  return <>TESTING</>;
}

Play around with DELAY, and occasionally get:

Application Error
TypeError: Failed to fetch
    at fetchData (http://localhost:3001/build/_shared/chunk-QJS5FCIL.js:6924:24)
    at http://localhost:3001/build/_shared/chunk-QJS5FCIL.js:7172:26
    at runHandler (http://localhost:3001/build/_shared/chunk-QJS5FCIL.js:2480:26)
    at callLoaderOrAction (http://localhost:3001/build/_shared/chunk-QJS5FCIL.js:2519:22)
    at http://localhost:3001/build/_shared/chunk-QJS5FCIL.js:1712:70
    at Array.map (<anonymous>)
    at callLoadersAndMaybeResolveData (http://localhost:3001/build/_shared/chunk-QJS5FCIL.js:1712:55)
    at handleLoaders (http://localhost:3001/build/_shared/chunk-QJS5FCIL.js:1327:15)
    at startNavigation (http://localhost:3001/build/_shared/chunk-QJS5FCIL.js:1169:15)
    at Object.revalidate (http://localhost:3001/build/_shared/chunk-QJS5FCIL.js:1096:7)

Expected Behavior

Should update the text in the route without throwing a fetch error

Actual Behavior

Application Error - Failed to fetch


My actual codebase throws this every time I make a change and the dev server is running. I'm suspecting some race condition with wrangler because when I set a breakpoint right before it throws, it always works.

@jacob-ebey
Copy link
Member

IDK if we can get around this in CF to be honest. There's no "HTTP port is available for connection" hook. Closest we can get is "code is loaded and we are restarting the http server". To get around this I introduced a retry mechanism for fetches caused by HDR in #6287.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

🤖 Hello there,

We just published version v0.0.0-nightly-70cc627-20230602 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions github-actions bot closed this as completed Jun 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

🤖 Hello there,

We just published version 1.17.0-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

🤖 Hello there,

We just published version 1.17.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

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

3 participants