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

Get "Expected fetch controller: :r1:" when calling fetcher.load and revalidator.revalidate #12049

Closed
tmcw opened this issue Sep 24, 2024 · 4 comments · Fixed by #12050
Closed
Labels
awaiting release This issue have been fixed and will be released soon

Comments

@tmcw
Copy link

tmcw commented Sep 24, 2024

Reproduction

https://stackblitz.com/edit/remix-run-remix-l7uvb2?file=app%2Froutes%2F_index.tsx

Open your developer tools console and click Trigger revalidations

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @remix-run/dev: * => 2.12.1 
    @remix-run/node: * => 2.12.1 
    @remix-run/react: * => 2.12.1 
    @remix-run/serve: * => 2.12.1 
    vite: ^5.1.0 => 5.4.7

Used Package Manager

npm

Expected Behavior

It should be possible to call fetchers and revalidators without throwing errors.

Actual Behavior

If you call

revalidator.revalidate();
revalidator.revalidate();
fetcher.load('/');

Then you will reliably trigger an uncaught error. If there's idle state to be dealt with here, it should possibly be dealt with behind the scenes. The revalidator docs state:

Race conditions are automatically handled when calling revalidate() when a revalidation is already in progress for any other reason.

Maybe we're supposed to handle race conditions with fetcher.load, but I don't see any notes about having to do that in the fetcher docs.

@brophdawg11
Copy link
Contributor

This doesn't cause any runtime issues right? Just an unexpected thrown error in the background, the associated console log, and maybe a window.onerror handler? Going tov remove this overzealous check in #12050 but just confirming there's no user-facing impact to ensure we're seeing the full picture

@brophdawg11 brophdawg11 self-assigned this Sep 30, 2024
@brophdawg11 brophdawg11 added the awaiting release This issue have been fixed and will be released soon label Oct 1, 2024
@brophdawg11 brophdawg11 removed their assignment Oct 1, 2024
@tmcw
Copy link
Author

tmcw commented Oct 1, 2024

Yes - as far as I can tell, there's no bug caused by this, but the console error was worrying and (to me) suggested that there was a problem in my application or I was using fetchers incorrectly. Thanks for removing it!

Copy link
Contributor

github-actions bot commented Oct 9, 2024

🤖 Hello there,

We just published version 6.27.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!

Copy link
Contributor

🤖 Hello there,

We just published version 6.27.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
Labels
awaiting release This issue have been fixed and will be released soon
Projects
None yet
2 participants