Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"npx shopify hydrogen debug cpu" is not working #2463

Open
DylanVann opened this issue Aug 22, 2024 · 3 comments
Open

"npx shopify hydrogen debug cpu" is not working #2463

DylanVann opened this issue Aug 22, 2024 · 3 comments
Labels
Bug Something isn't working SEV-4

Comments

@DylanVann
Copy link

What is the location of your example repository?

You can create a new Hydrogen project and it will have this issue

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

2024.7.4

What version of Remix are you using?

2.10.1

Steps to Reproduce

  1. Create a new Hydrogen project using npm create @shopify/hydrogen@latest.
  2. Try to use npx shopify hydrogen debug cpu

Expected Behavior

CPU profiling to work.

Actual Behavior

I get an error that says SourceMapConsumer is not a constructor.

Image

I did some investigating and it looks like there's a couple issues, the first one seems to be related to CJS compat in the cpu-profiler.ts file where it imports source-map. When the file is actually run SourceMapConsumer is on default from that module. After resolving that there seems to be an issue where Hydrogen is not finishing the build when profiling.

@wizardlyhel
Copy link
Contributor

@DylanVann I am unable to reproduce this locally. Would you provide more information around node/npm version?

@DylanVann
Copy link
Author

I don't think there's anything unique to this environment:

Image

Node - 20.17.0
npm - 10.8.1

Thanks for looking into it!

@wizardlyhel
Copy link
Contributor

wizardlyhel commented Aug 23, 2024

Okay I can reproduce this. (The error doesn't show up when running cpu profiling in Hydrogen repo's skeleton template)

  1. Generate a brand new project
  2. Run npx shopify hydrogen debug cpu

@wizardlyhel wizardlyhel added Bug Something isn't working SEV-4 labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working SEV-4
Projects
None yet
Development

No branches or pull requests

2 participants