hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

[BUG] `npm run preview` doesn't work with fresh Demo Store template

Open ramiroazar opened this issue 3 years ago • 3 comments

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

  1. Create a Hydrogen storefront with the Demo Store template (e.g. npm init @shopify/hydrogen -- --template demo-store --ts)
  2. Build project (e.g. npm run build)
  3. Preview project (e.g. npm run preview)
  4. 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)

ramiroazar avatar Oct 24 '22 04:10 ramiroazar

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

  1. Create a Hydrogen storefront with the Demo Store template (e.g. npm init @shopify/hydrogen -- --template demo-store --ts)
  2. Build project (e.g. npm run build)
  3. Preview project (e.g. npm run preview)
  4. 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: @.***>

sebinievas avatar Oct 24 '22 04:10 sebinievas

Hello, sorry, I should have mentioned that I tried [email protected] as well with the same result.

ramiroazar avatar Oct 24 '22 04:10 ramiroazar

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

tylerhellner avatar Oct 25 '22 07:10 tylerhellner

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.

shopify[bot] avatar Jun 18 '24 17:06 shopify[bot]