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

Shopify Hydrogen Server Instrumentation Error #15612

Closed
allenjiang17 opened this issue Mar 6, 2025 · 3 comments · Fixed by #15610
Closed

Shopify Hydrogen Server Instrumentation Error #15612

allenjiang17 opened this issue Mar 6, 2025 · 3 comments · Fixed by #15610
Assignees

Comments

@allenjiang17
Copy link

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

I've followed this guide to set up Sentry for Shopify Hydrogen:
https://docs.sentry.io/platforms/javascript/guides/remix/frameworks/hydrogen/

Specifically, instrumenting the server build

const instrumentedBuild = instrumentBuild(remixBuild)

causes an error in my server build. When I make a request to any of my server actions, I get the error

TypeError: Cannot read properties of undefined (reading 'sendDefaultPii')
at /Users/.../fp_storefront_hydrogen/node_modules/@sentry/remix/build/esm/server/errors.js:132:21

I've confirmed that it's specifically this step of instrumenting the server build that causes the problem, as when I comment it out and make requests to my server actions, it works fine.

Expected Result

No errors upon making requests to server actions after instrumenting the server build.

Actual Result

TypeError: Cannot read properties of undefined (reading 'sendDefaultPii')
at /Users/.../fp_storefront_hydrogen/node_modules/@sentry/remix/build/esm/server/errors.js:132:21

Product Area

Unknown

Link

No response

DSN

No response

Version

No response

@getsantry
Copy link

getsantry bot commented Mar 6, 2025

Assigning to @getsentry/support for routing ⏲️

@onurtemizkan
Copy link
Collaborator

onurtemizkan commented Mar 6, 2025

Thanks for the issue report @allenjiang17!

Can you try running instrumentBuild inside the fetch handler instead of the root?

I'll update the docs accordingly if that's the case.

@allenjiang17
Copy link
Author

Just tried it inside the fetch handler -- still the same issue. Thanks for the quick response.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Mar 6, 2025
@ReneGreen27 ReneGreen27 transferred this issue from getsentry/sentry Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants