Fail to run preview
Hi guys
I had problems with deploying Hydrogen app to netlify, so I tried using the provided starter app. It did work on netlify, but when I ran preview on local, I ran into worker not found error.
I also manually ran npx @shopify/hydrogen-cli preview (v 0.12.1)and here is the error.

I've tried with Node 16.5, 16.7 and 18. How do you guys successfully run preview?
Thanks!!
I'm also running into this same error, but a step behind you! I couldn't get the starter repo to work on Netlify (using a simple manual netlify deploy after checking out the repo). It errors out when loading. Did you do anything special to get it working?
@jamosonic I just forked the starter app, then deployed on Netlify with github directly, there was no issue at all.
Thanks for the tip. Clicked the deploy button in the readme instead and it worked 🙃. Weird!
Note this line in the error thrown.
WorkerNotFoundError: A worker file is required for this command. Try building your project or check your mini-oxygen config file to ensure a workerFile is specified and the path is correct.
Try running build before preview as described below.
https://github.com/Shopify/hydrogen/tree/v1.x-2022-07/templates/demo-store#previewing-a-production-build
Does that work for you?
@kyakaze @jamosonic if you are using the @netlify/hydrogen-platform plugin then the worker will not be created on build. Instead a .netlify/edge-functions directory will be created.
To preview your build locally, you can:
- Remove the
netlifyPlugin()fron yourvite.config.jspluginsarray (Please note that this will break your Netlify deploy) - Install Netlify CLI and run
netlify devto mimic the Netlify Edge Function deployment locally
pausing this PR as our release version need to be re-think
Oxygen deployed a preview of your mc-changelog-update branch. Details:
| Storefront | Status | Preview link | Deployment details | Last update (UTC) |
|---|---|---|---|---|
| Skeleton (skeleton.hydrogen.shop) | ✅ Successful (Logs) | Preview deployment | Inspect deployment | May 8, 2024 2:48 PM |
| subscriptions | ✅ Successful (Logs) | Preview deployment | Inspect deployment | May 8, 2024 2:47 PM |
| custom-cart-method | ✅ Successful (Logs) | Preview deployment | Inspect deployment | May 8, 2024 2:48 PM |
| vite | ✅ Successful (Logs) | Preview deployment | Inspect deployment | May 8, 2024 2:48 PM |
| optimistic-cart-ui | ✅ Successful (Logs) | Preview deployment | Inspect deployment | May 8, 2024 2:47 PM |
| third-party-queries-caching | ✅ Successful (Logs) | Preview deployment | Inspect deployment | May 8, 2024 2:48 PM |
Learn more about Hydrogen's GitHub integration.