Skip to content

Hydrogen 2025.1.3 / @sentry/remix build failing #16120

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

Closed
3 tasks done
jasonloeve opened this issue Apr 23, 2025 · 3 comments · Fixed by #16124
Closed
3 tasks done

Hydrogen 2025.1.3 / @sentry/remix build failing #16120

jasonloeve opened this issue Apr 23, 2025 · 3 comments · Fixed by #16124

Comments

@jasonloeve
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/remix

SDK Version

^9.13.0

Framework Version

@shopify/hydrogen 2025.1.3 , vite ^6.2.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

https://github.com/jasonloeve/hydrogen-sentry

Steps to Reproduce

  1. Install a fresh instance of Hydrogen 2025.1.3
  2. Install Sentry following the guild set out in -https://docs.sentry.io/platforms/javascript/guides/remix/frameworks/hydrogen/
  3. Run build using npm run build using node v21.7.0 / npm 10.5.0
  4. Build throws and error

Expected Result

Expected build to complete successfully.

To note that Hydrogen has just pushed updates switching from Vite 5 to Vite 6, this this update this issue has been present.

Actual Result

Build fails with error, seems to be failing at entry.client.tsx , @sentry/remix

Error: Failed to resolve entry for package "@sentry/remix". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "@sentry/remix" package at packageEntryFailure (file:///Users/Sites/hydrogen-remix/source/node_modules/vite/dist/node/chunks/dep-DG3BLbPj.js:16195:15) at resolvePackageEntry (file:///Users/Sites/hydrogen-remix/source/node_modules/vite/dist/node/chunks/dep-DG3BLbPj.js:16190:5) at tryNodeResolve (file:///Users/Sites/hydrogen-remix/source/node_modules/vite/dist/node/chunks/dep-DG3BLbPj.js:16057:18) at Object.resolveId (file:///Users/Sites/hydrogen-remix/source/node_modules/vite/dist/node/chunks/dep-DG3BLbPj.js:15828:19) at Object.handler (file:///Users/Sites/hydrogen-remix/source/node_modules/vite/dist/node/chunks/dep-DG3BLbPj.js:46392:15) at file:///Users/Sites/hydrogen-remix/source/node_modules/rollup/dist/es/shared/node-entry.js:22188:40 at PluginDriver.hookFirstAndGetPlugin (file:///Users/Sites/hydrogen-remix/source/node_modules/rollup/dist/es/shared/node-entry.js:22070:28) at resolveId (file:///Users/Sites/hydrogen-remix/source/node_modules/rollup/dist/es/shared/node-entry.js:20552:26) at ModuleLoader.resolveId (file:///Users/Sites/hydrogen-remix/source/node_modules/rollup/dist/es/shared/node-entry.js:20988:15) at Object.resolveId (/Users/Sites/hydrogen-remix/source/node_modules/@remix-run/dev/dist/vite/plugin.js:964:22)

@s1gr1d
Copy link
Member

s1gr1d commented Apr 24, 2025

Thanks for opening this issue and for providing a reproduction!

It seems to be an issue with Vite 6. If you downgrade the version it works. But we still have to look into why Sentry is failing with the Vite 6 setup.

@s1gr1d
Copy link
Member

s1gr1d commented Apr 24, 2025

I added a PR to fix our exports in the package.json. However, Vite 6 made some changes for resolve.conditions (docs here) and it could be that this is also a Vite 6 bug.

With the fixed exports, the error you posted is gone, but Remix itself shows the following error:

Error: Server-only module referenced by client

    '@sentry/remix' imported by 'app/entry.client.tsx'

  See https://remix.run/docs/en/main/guides/vite#splitting-up-client-and-server-code

Our package exports look fine - we distinguish between browser and node.

@jasonloeve Would you be so kind and update your reproduction example to the latest Sentry version once the PR is released in the next version? Then I would open an issue in the Vite repository.

Copy link
Contributor

A PR closing this issue has just been released 🚀

This issue was referenced by PR #16124, which was included in the 9.15.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants