hydrogen: npm run dev failing with codegen

What is the location of your example repository?

No response

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

2023.10.2

What version of Remix are you using?

2.1.0

Steps to Reproduce

image

Getting this failure after setting up a project with the CLI using the scaffolded routes. Only change to repo is installing Husky and adding the .husky configs then adding the shopify generated PR for Oxygen deployment. Went to run npm run dev on node version 20.9.0 and it errors out in the codegen steps.

Expected Behavior

I expected the dev server to start cleanly

Actual Behavior

The dev server process fails on the codegen step. It runs fine when I run the dev server without the --codegen flag and the codegen command fails when run seperately.

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

I ran into this isse. Seems wierd, but if the github repo name is different from the project name that was created locally when creating the shopify hydrogen app. You will get that error.

In helping out a friend that cloned down my hydrogen app repo, I had him go in finder and rename his local version of the project to the name of the project I created locally before pushing up to github.

I came to the conclusion of having him rename his local instance of the app to the name of the app I have locally after looking at the codejen.js node module file, which was related to the root directory of the project.

example:

  • create a hydrogen app locally
  • name the storefront my-app
  • create repo in github named main-storefront-app
  • add git remote for my-app to main-storefront-app repo
  • another user clones down repo but doesn’t rename local instance when cloning to my-app
  • npm run dev will produce the error mentioned here

fix:

  • go in finder or through terminal and rename local instance of main-storefront-app to my-app
  • tada

@EvanMiller12 Have you found the reason why it is like that? Thanks