-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.71.0
Framework Version
Next.js 13.5.3-canary.3
Link to Sentry event
No response
SDK Setup
Sentry.init({
dsn: REDACTED,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
replaysOnErrorSampleRate: 1.0,
// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,
// You can remove this option if you're not planning to use the Sentry Session Replay feature:
integrations: [
new Sentry.Replay({
// Additional Replay configuration goes in here, for example:
maskAllText: true,
blockAllMedia: true,
}),
],
});
Steps to Reproduce
- Add
import * as Sentry from '@sentry/nextjs';to a file - Import this file from a client component
Expected Result
The code should be imported with no side-effects in the log.
Actual Result
With lib/reportError.ts defined as such:
import * as Sentry from '@sentry/nextjs';
export function reportError(e: Error, params?: object) {
Sentry.captureException(e, params);
}
Importing it results in the following appearing every time in my dev console.
./node_modules/@sentry/nextjs/cjs/config/webpack.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
Import trace for requested module:
./node_modules/@sentry/nextjs/cjs/config/webpack.js
./node_modules/@sentry/nextjs/cjs/config/withSentryConfig.js
./node_modules/@sentry/nextjs/cjs/index.server.js
./lib/reportError.ts
./component/that/was/imported/First.tsx
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
No status