[BUG] `npm run preview` doesn't work with fresh Demo Store template
Describe the bug
Installing a fresh demo store by following the documentation and previewing it displays the following error.
To use the new ReadableStream() constructor, enable the streams_enable_constructors feature flag.
Meanwhile, the following is logged to the terminal.
(node:13497) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time.
https://shopify.dev/custom-storefronts/hydrogen/templates#demo-store-template
To Reproduce
- Create a Hydrogen storefront with the Demo Store template (e.g.
npm init @shopify/hydrogen -- --template demo-store --ts) - Build project (e.g.
npm run build) - Preview project (e.g.
npm run preview) - Open preview URL and note the error mentioned above (e.g.
http://localhost:3000/)
Expected behaviour
npm run preview should render the store like npm run dev does instead of a blank page with an error.
- Hydrogen version
1.6.0 - Node version
16.18.0 - Device details
iMac (macOS Monterey 12.4)
Try node 18.
On Sun, Oct 23, 2022 at 11:28 PM Ramiro Azar @.***> wrote:
Describe the bug
Installing a fresh demo store by following the documentation and previewing it displays the following error.
To use the new ReadableStream() constructor, enable the streams_enable_constructors feature flag.
Meanwhile, the following is logged to the terminal.
(node:13497) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time.
https://shopify.dev/custom-storefronts/hydrogen/templates#demo-store-template
To Reproduce
- Create a Hydrogen storefront with the Demo Store template (e.g. npm init @shopify/hydrogen -- --template demo-store --ts)
- Build project (e.g. npm run build)
- Preview project (e.g. npm run preview)
- Open preview URL and note the error mentioned above (e.g. http://localhost:3000/)
Expected behaviour
npm run preview should render the store like npm run dev does instead of a blank page with an error.
- Hydrogen version 1.6.0
- Node version 16.18.0
- Device details iMac (macOS Monterey 12.4)
— Reply to this email directly, view it on GitHub https://github.com/Shopify/hydrogen/issues/2263, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC5IRIMFH4KBZKWGAMAOLLWEYF6HANCNFSM6AAAAAARMTOIOQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hello, sorry, I should have mentioned that I tried [email protected] as well with the same result.
Happens to me too (on node v18.9.0) on both the fresh demo store and the store my company is developing. The logs always 404 out.
│ [STARTED] Building client code │
│ [TITLE] Built client code │
│ [SUCCESS] Built client code │
│ [STARTED] Building worker code │
│ [TITLE] Built worker code │
│ [SUCCESS] Built worker code │
│ [mf:inf] Build succeeded │
│ [mf:vrb] - setup(CorePlugin) │
│ [mf:vrb] - setup(CachePlugin) │
│ [mf:vrb] - setup(BindingsPlugin) │
│ [mf:dbg] Reloading worker... │
│ [mf:vrb] - beforeReload(BindingsPlugin) │
│ [mf:vrb] Running script... │
│ [mf:vrb] - reload(BindingsPlugin) │
│ [mf:inf] Worker reloaded! (0.54MiB) │
│ [mf:dbg] Watching dist/worker/index.js, src... │
│ GET streaming SSR 404 error 416.00 ms http://localhost:3000/__vite_ping │
│ GET streaming SSR 404 error 417.00 ms http://localhost:3000/__vite_ping │
│ GET streaming SSR 404 error 168.00 ms http://localhost:3000/__vite_ping │
│ GET streaming SSR 404 error 151.00 ms http://localhost:3000/__vite_ping │
│ GET streaming SSR 404 error 178.00 ms http://localhost:3000/__vite_ping │
│ GET streaming SSR 404 error 182.00 ms http://localhost:3000/__vite_ping │
│ GET streaming SSR 404 error 159.00 ms http://localhost:3000/__vite_ping │
│ GET streaming SSR 404 error 306.00 ms http://localhost:3000/__vite_ping │
│ GET streaming SSR 404 error 309.00 ms http://localhost:3000/__vite_ping │
│ GET streaming SSR 404 error 287.00 ms http://localhost:3000/__vite_ping │
│ GET streaming SSR 404 error 346.00 ms http://localhost:3000/__vite_ping
Oxygen deployed a preview of your dependabot/npm_and_yarn/npm_and_yarn-dc8883c465 branch. Details:
| Storefront | Status | Preview link | Deployment details | Last update (UTC) |
|---|---|---|---|---|
| classic-remix | ✅ Successful (Logs) | Preview deployment | Inspect deployment | June 20, 2024 5:04 PM |
| metaobjects | ✅ Successful (Logs) | Preview deployment | Inspect deployment | June 20, 2024 5:04 PM |
| optimistic-cart-ui | ✅ Successful (Logs) | Preview deployment | Inspect deployment | June 20, 2024 5:04 PM |
| third-party-queries-caching | ✅ Successful (Logs) | Preview deployment | Inspect deployment | June 20, 2024 5:04 PM |
| Skeleton (skeleton.hydrogen.shop) | ✅ Successful (Logs) | Preview deployment | Inspect deployment | June 20, 2024 5:04 PM |
| custom-cart-method | ✅ Successful (Logs) | Preview deployment | Inspect deployment | June 20, 2024 5:04 PM |
Learn more about Hydrogen's GitHub integration.