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

Sentry Remix Vite & Shopify Oxygen/Hydrogen #13061

Closed
3 tasks done
theocerutti opened this issue Jul 26, 2024 · 3 comments
Closed
3 tasks done

Sentry Remix Vite & Shopify Oxygen/Hydrogen #13061

theocerutti opened this issue Jul 26, 2024 · 3 comments
Labels
Package: remix Issues related to the Sentry Remix SDK Type: Bug

Comments

@theocerutti
Copy link

theocerutti commented Jul 26, 2024

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

^8.20.0

Framework Version

Remix ^2.4.1

Link to Sentry event

No response

SDK Setup/Reproduction Example

// entry.client.tsx

import * as Sentry from '@sentry/remix';

import { SENTRY_DSN } from './lib/constants';

Sentry.init({
  dsn: SENTRY_DSN,
  environment: 'staging',
  tracesSampleRate: 1,
  integrations: [
    Sentry.browserTracingIntegration({
      useEffect,
      useLocation,
      useMatches,
    }),
    Sentry.replayIntegration(),
  ],
});
// entry.server.tsx

import * as Sentry from '@sentry/remix';
import { SENTRY_DSN } from '~/lib/constants';

Sentry.init({
  dsn: SENTRY_DSN,
  tracesSampleRate: 1,
  environment: 'staging',
});

export const handleError = Sentry.sentryHandleError;
// root.tsx

...
export default withSentry(App);
...

Steps to Reproduce

1/ Run npm create @shopify/hydrogen@latest -- --template demo-store
2/ Install @sentry-remix: 'npm run @sentry/remix'
3/ Add sentry related code to enable sentry in root.tsx, entry.server.tsx, entry.client.tsx
4/ Link project to a storefront and run npx hydrogen deploy
5/ -> Deployment Error

Expected Result

To have a succesfull deployment

Since the worker is built on Oxygen (which is built on Cloudlfare) maybe there is some missing functionnality ???
However the problem is that when I was on Remix Classic Compiler (not using Vite) it was working fine!!

Actual Result

Error:

Image

@github-actions github-actions bot added the Package: remix Issues related to the Sentry Remix SDK label Jul 26, 2024
@s1gr1d
Copy link
Member

s1gr1d commented Jul 26, 2024

Hello, thanks for filing this issue! Does this project run locally without problems or do you get an error as well? And did you deploy it somewhere else (not oxygen) already successfully?

Can you try turning on logs with debug: true to see if there is some output that could be helpful?

@theocerutti
Copy link
Author

@s1gr1d Yes the project runs locally without problems. I didn't deployed it somewhere else.
The sentry debug: true is kinda useless in this case because the error doesn't occurs when the project is running but it seems it's when oxygen tries to start it or something like that.

@AbhiPrasad
Copy link
Member

@theocerutti as per https://docs.sentry.io/platforms/javascript/guides/remix/

Sentry's Remix SDK does not officially support adapters that use non-Node runtimes, such as Cloudflare Workers.

Therefore the Remix SDK does not officially support non-Node.js runtimes for the server. You'll have to remove all Sentry related code from entry.server.tsx for the time being.

We are actively working on a Cloudflare Worker SDK #12620 which should make this better!

This is being tracked with #5610 - so I am going to close this issue.

@AbhiPrasad AbhiPrasad closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: remix Issues related to the Sentry Remix SDK Type: Bug
Projects
Archived in project
Development

No branches or pull requests

3 participants