Shopify / hydrogen

Hydrogen lets you build faster headless storefronts in less time, on Shopify.
https://hydrogen.shop
MIT License
1.19k stars 241 forks source link

Error: [o2:runtime] External modules are not supported when generating new project following getting started docs #2031

Closed ElijahKotyluk closed 3 weeks ago

ElijahKotyluk commented 3 weeks ago

What is the location of your example repository?

No response

Which package or tool is having this issue?

CLI

What version of that package or tool are you using?

3.58.0

What version of Remix are you using?

@shopify/remix-oxygen: ^2.0.4

Steps to Reproduce

Follow the docs( https://shopify.dev/docs/custom-storefronts/hydrogen/getting-started ) and generate a new project, connect the project and complete the scaffolding and setup process. You will then be asked to cd into your new project's directory and run the following command:

npm run dev

Expected Behavior

The project will run without any errors when generating a new project from the getting started scaffold.

Actual Behavior

Error: [o2:runtime] External modules are not supported: "file:///../path/to/project/node_modules/@remix-run/react/dist/index.js"

blittle commented 3 weeks ago

I'm sorry about this, a commit in the latest version of Remix breaks Hydrogen. We are working with the Remix team to resolve this asap. In the mean time, please pin your project to Remix 2.8.1.

ElijahKotyluk commented 3 weeks ago

@blittle Thank you for the prompt response, greatly appreciated.

Going to leave this extra bit here for anyone else who may run into this issue: I ended up pinning all @remix/* packages in the repository to 2.8.1 which led to another error:

Error: Cannot find package 'undici' imported from /path/to/project/node_modules/@shopify/mini-oxygen/dist/worker/devtools.js
    Code: ERR_MODULE_NOT_FOUND

To fix this, just add the undici package and all should run fine.

blittle commented 3 weeks ago

This is the fix on Remix's end. We are waiting for a 2.9.1 release.

brophdawg11 commented 3 weeks ago

remix@2.9.1 is published - https://github.com/remix-run/remix/releases/tag/remix%402.9.1