[BUG] `shopify hydrogen build` hangs after the build is done
Describe the bug
When running shopify hydrogen build, the process doesn't exit after the actual build is done, meaning it hangs indefinitely until canceled manually.
To Reproduce
- Run
shopify hydrogen build ---target node
Expected behaviour I expect the process to exit after the build is done.
Screenshots No screenshot, but the last few logs:
✓ 697 modules transformed.
rendering chunks...
dist/node/index.js 805.14 KiB
dist/node/index.js.map 1870.76 KiB
[TITLE] Built node code
[SUCCESS] Built node code
<hang...>
Additional context
Noticeable is that it used to work when we were still running on version 0.17.0. We made a giant leap from 0.17.0 to 1.3.0, implementing all react-side changes of Hydrogen, which does work when serving locally. Next to fixing the breaking changes from 0.17.0 to 1.3.0, the codebase didn't change. When running hydrogen shopify build, it doesn't exit the build process, while no error messages printed.
A major thing that changed is that with 0.17.0 we were still running on node v14, while after the bump, we had to use node v16. Maybe that broke something.
Also noticeable is that the output is actually a valid build, so when I manually cancel the process, I am actually able to run the dist version of the app. However, we need the process to exit in order to use it in our build pipeline properly.
Furthermore, this also happened when we were still invoking vite manually. The logs would differ, but the process would also hang after a proper build had been made. The command was vite build --outDir ../../../dist --manifest. We migrated to shopify hydrogen build in the hope that that would fix our hanging issue, but unfortunately, it didn't.
Fourth note, I tried porting the source code over the a freshly scaffolded hydrogen app, but the hanging issue would still persist.
- Hydrogen version: 1.3.0
- Node version: 16.15.1
- Device details: macOS Monterey