Skip to content

Using node.js packages #1535

Closed Answered by blittle
carstensbix asked this question in Help
Discussion options

You must be logged in to vote

Hi @carstensbix. By default Hydrogen is meant to run on Oxygen, which is worker runtime environment. Worker runtimes (like Cloudflare, Vercel, and others) are not NodeJS, and do not provide the NodeJS APIs. Read more about the Oxygen runtime at: https://shopify.dev/docs/custom-storefronts/hydrogen/deployments/oxygen-runtime

If you'd like to use NodeJS libraries, you can either try to pollyfill those Node APIs (potentially difficult and bug prone), or you could just not deploy to Oxygen at all. Instead, setup Hydrogen with Express or another NodeJS webserver. We provide an example on how to do this here: https://github.com/Shopify/hydrogen/tree/main/examples/express

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by blittle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants