Hydrogen deploy to Cloudflare

I built hydrogen in my development environment and deployed it to Cloudflare’s workers.
However, when I access it, it says “Oxygen is not defined”.

I “localhost:3000” checked.
This was no problem.

Below are the steps I performed:

npm install @cloudflare/kv-asset-handler

wrangler.toml

wrangler.toml
account_id = ""
compatibility_date = "2022-11-22"
compatibility_flags = ["streams_enable_constructors"]
#main = "dist/worker/index.js"
main = "./worker.js"
name = "hydrogen-app"
route = ""
workers_dev = true
type = "javascript"
zone_id = ""

[site]
bucket = "dist/client"
entry-point = "dist/worker"

[build]
upload.format = "service-worker"
command = "yarn && yarn build"

packge.json

"build": "shopify hydrogen build --entry worker",

worker.js

https://shopify.dev/custom-storefronts/hydrogen/deployment

do you know what i should do?

Hi Bro,

You need to access Cloudflare vars like this:

storeDomain:
// @TS -ignore
process.env.PUBLIC_STORE_DOMAIN || ‘xxx.myshopify.com’,
storefrontToken:
// @TS -ignore
process.env.PUBLIC_STOREFRONT_API_TOKEN ||
‘xxx’,
privateStorefrontToken:
// @TS -ignore
process.env[‘PRIVATE_STOREFRONT_API_TOKEN’],
storefrontApiVersion: ‘2022-07’,
// @TS -ignore
storefrontId: process.env.PUBLIC_STOREFRONT_ID,
},

Add them in settings first.

Regards
Damian

@damiankrzyz Thanks for the answers.
how I can host Hydrogen build GCP or AWS platform?