Error Running “run dev” in Shopify Hydrogen: Workers Runtime Failure with Miniflare/MiniOxygen on Windows 11

Error Running “run dev” in Shopify Hydrogen: Workers Runtime Failure with Miniflare/MiniOxygen on Windows 11

Description:

I am experiencing an issue when starting the local development server using the latest version of Shopify Hydrogen on Windows 11. When executing the run dev command, an error related to the Workers runtime—specifically with Miniflare/MiniOxygen—is thrown, preventing the server from starting correctly.

Steps to Reproduce:

  1. Clone or create a project based on Shopify Hydrogen (latest version).

  2. Run npm install to install all dependencies.

  3. Execute npm run dev (or the equivalent command) to start the development server.

  4. Observe that an error related to Miniflare/MiniOxygen is displayed.

Reported errors

MiniOxygen: Error during evaluation: MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
at Miniflare2.#assembleAndUpdateConfig (C:\Users\user\hydrogen-storefront\node_modules\miniflare\src\index.ts:1437:10)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at Mutex.runWith (C:\Users\user\hydrogen-storefront\node_modules\miniflare\src\workers\shared\sync.ts:66:45) {
code: ‘ERR_RUNTIME_FAILURE’,
cause: undefined
}
MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
at Miniflare2.#assembleAndUpdateConfig (C:\Users\user\hydrogen-storefront\node_modules\miniflare\src\index.ts:1437:10)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at Mutex.runWith (C:\Users\user\hydrogen-storefront\node_modules\miniflare\src\workers\shared\sync.ts:66:45)

Expected Result:

The development server should start correctly, simulating the Cloudflare Workers environment via Miniflare without any errors.

Actual Result:

The server does not start, and the errors mentioned above are displayed, preventing further development.

Environment Information :

• Operating System: Windows 11

• Shopify Hydrogen Version: Latest version available

• Miniflare (it is recommended to upgrade to version 4, as version 2 is deprecated) I’ve tested both versions.

• MiniOxygen

• Node.js Version: I have tested Node versions from 16 to 22.

Additional Notes:

• I have verified the Miniflare configuration and enabled verbose logging options to gather more details, but the error persists.

• The error messages indicate a failure in the Workers runtime, suggesting possible incompatibilities or misconfigurations in the simulated environment.

• Some related packages are showing deprecation warnings, which suggests that updating to supported versions (e.g., migrating to Miniflare v4) might be necessary.

Request:

Has anyone experienced this issue or can provide guidance on how to resolve the Workers runtime error when executing run dev? I appreciate any suggestions or solutions that would allow me to continue with local development of my application.