Closed jasonloeve closed 2 months ago
Can you share your init code, as well as in which file you put it? This sounds like you are loading nodeProfilingIntegration
in entry.client.js
or something along these lines!
Hey @mydea ,
So Im working with Shopify Hydrogen (Remix)
entry.client.tsx
import * as Sentry from '@sentry/remix';
import {RemixBrowser, useLocation, useMatches} from '@remix-run/react';
import {startTransition, StrictMode, useEffect} from 'react';
import {hydrateRoot} from 'react-dom/client';
Sentry.init({
dsn: 'https://xxxxxxxxxxxxx@xxxxxxxxxxxxxxx.ingest.us.sentry.io/xxxxxxxxxxxxxxx',
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1,
integrations: [
Sentry.browserTracingIntegration({
useEffect,
useLocation,
useMatches,
}),
Sentry.replayIntegration(),
Sentry.browserProfilingIntegration(),
],
});
startTransition(() => {
hydrateRoot(
document,
<StrictMode>
<RemixBrowser />
</StrictMode>,
);
});
entry.server.tsx
import * as Sentry from '@sentry/remix';
import {nodeProfilingIntegration} from '@sentry/profiling-node';
import type {EntryContext} from '@shopify/remix-oxygen';
import {RemixServer} from '@remix-run/react';
import isbot from 'isbot';
import {renderToReadableStream} from 'react-dom/server';
import {createContentSecurityPolicy} from '@shopify/hydrogen';
export function handleError(error, {request}) {
Sentry.captureRemixServerException(error, 'remix.server', request);
}
Sentry.init({
dsn: 'https://xxxxxxxxxxxxx@xxxxxxxxxxxxxxx.ingest.us.sentry.io/xxxxxxxxxxxxxxx',
// debug: true,
tracesSampleRate: 1.0,
profilesSampleRate: 1,
integrations: [nodeProfilingIntegration()],
});
.......................
@jasonloeve I lack a bit of knowledge on hydrogen but I think it does generally not run on Node.js but on a worker runtime instead (at least when looking at this https://github.com/Shopify/hydrogen/discussions/1535). It running on a worker runtime means that most of the Node.js API is not available. As of now, our SDK is not cut out for this. Is this only a problem when using the nodeProfilingIntegration()
or do you get similar errors after removing it?
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community
, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
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
7.114.0
Framework Version
^18.2.0
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
Expected Result
The application to build out
Actual Result
Receiving the following errors
`✘ [ERROR] Could not resolve "os"
The package "os" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
✘ [ERROR] Could not resolve "path"
The package "path" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
✘ [ERROR] Could not resolve "worker_threads"
The package "worker_threads" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
✘ [ERROR] Could not resolve "child_process"
The package "child_process" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
✘ [ERROR] Could not resolve "fs"
The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error. `