Comments (8)
It should be fine to inti the edge SDK with a dynamic import. If possible, try to leave the node SDK init synchronous.
from sentry-javascript.
This is actually a good insight. Thanks for raising this! I see this as a documentation issue we need to resolve.
from sentry-javascript.
Problem with @sentry/profiling-node
integration
from sentry-javascript.
@r34son profiling will not work without a nodejs API, so I would recommend you remove this for edge runtime. I will need to look at how and if it's even possible to support this. I'm sorry if this isnt of much help.
from sentry-javascript.
@r34son profiling will not work without a nodejs API, so I would recommend you remove this for edge runtime. I will need to look at how and if it's even possible to support this. I'm sorry if this isnt of much help.
It is actually the problem, because of one chunk emited for both runtimes
from sentry-javascript.
Thanks!
from sentry-javascript.
If I init sdk this way:
import { init } from '@sentry/nextjs';
import { nodeProfilingIntegration } from '@sentry/profiling-node';
import { SENTRY_CAPTURE_RATE, SENTRY_DSN } from 'sentry.constants.mjs';
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
init({
dsn: SENTRY_DSN,
debug: false,
tracesSampleRate: SENTRY_CAPTURE_RATE,
profilesSampleRate: SENTRY_CAPTURE_RATE,
environment: process.env.ENV,
integrations: [nodeProfilingIntegration()],
});
}
if (process.env.NEXT_RUNTIME === 'edge') {
await import('./instrumentation.edge');
}
}
It somehow fails in turbopack:
from sentry-javascript.
Only works importing @sentry/profiling-node
dynamically:
import { init } from '@sentry/nextjs';
import { SENTRY_CAPTURE_RATE, SENTRY_DSN } from 'sentry.constants.mjs';
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
const { nodeProfilingIntegration } = await import('@sentry/profiling-node');
init({
dsn: SENTRY_DSN,
debug: false,
tracesSampleRate: SENTRY_CAPTURE_RATE,
profilesSampleRate: SENTRY_CAPTURE_RATE,
environment: process.env.ENV,
integrations: [nodeProfilingIntegration()],
});
}
if (process.env.NEXT_RUNTIME === 'edge') {
await import('./instrumentation.edge');
}
}
from sentry-javascript.
Related Issues (20)
- SDK fails in ESM mode in combination with date-fns HOT 10
- `isOlderThan` is not a function HOT 2
- Ensure `browserProflingIntegration` is published to CDN HOT 4
- Source Map for ReactJS app not working as expected. HOT 6
- Custom breadcrumbs don't show up in Replays HOT 3
- Metric methods should enforce number inputs
- Errors with large payloads causing silently dropped events HOT 3
- Unable to install profiling-node on alpine HOT 6
- Property 'setupNestErrorHandler' does not exist on type 'typeof import("/app/node_modules/@sentry/node/types/index")' HOT 5
- [contextLines]: reduce memory usage HOT 3
- Ember Canary ember-release Test Failed HOT 2
- nextjs-14 (canary) Test Failed
- nextjs-app-dir (canary) Test Failed HOT 1
- Astro Integration throws error after upgrade to v8.3.0 HOT 8
- Add support for angular v18 HOT 1
- Mongo instrumentation doesn't work with promises HOT 4
- Replay no longer reexported by @sentry/nextjs after upgrade to v8 HOT 1
- Release v8 for loader script HOT 3
- Create versioned global sentry carrier object
- Astro integration follow the guide will get a error ENOENT: no such file or directory, open '/Users/xxx/astro-project/node_modules/@sentry/astro/esm/@sentry/node' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-javascript.