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

Issues with fetching third party data when using MiniOxygen worker runtime #1784

Closed
mwshepherd opened this issue Feb 21, 2024 · 1 comment · Fixed by #1819
Closed

Issues with fetching third party data when using MiniOxygen worker runtime #1784

mwshepherd opened this issue Feb 21, 2024 · 1 comment · Fixed by #1819

Comments

@mwshepherd
Copy link

What is the location of your example repository?

No response

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

Hydrogen ~2024.1.1

What version of Remix are you using?

2.5.1

Steps to Reproduce

  1. Make a query to a third party api in the loader function while using the worker runtime locally (using the --legacy-runtime fixes this issue)

Following the Hydrogen docs for third party data fetching (https://shopify.dev/docs/custom-storefronts/hydrogen/data-fetching/third-party), I have created my own api client for searchspring, initialised it in the Remix context and queried in the loader of a collection route. This works fine the first few times, however at a certain point the route will just stop working, freeze and stay pending forever.

I wrote the initial code on Hydrogen ~2023.10.3 and it works fine so curious to know if this is related to the recent update

The only way to fix this after it has crashed for the first time is to then pass the promise out of the loader use Suspense and Await to resolve it client side or just use the --legacy-runtime flag when running dev

Here is a link to another potentially related issue raised that describes similar behaviour: #1720

Expected Behavior

Data fetching from a third party api should be able to be queried and resolve server side in the loader function of a route

Actual Behavior

Route will never resolve and stays pending forever and will crash the entire app.

@wizardlyhel
Copy link
Contributor

@mwshepherd would you please share your computer spec? We work on Hydrogen everyday and haven't been able to reproduce this issue. So am suspecting it might has something to do with the computer spec. If it is, it would give us a direction to look into where the problem might be

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

Successfully merging a pull request may close this issue.

2 participants