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.64.0
Framework Version
7.64.0
Link to Sentry event
No response
SDK Setup
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: "mydsn",
// 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
- Create a next project using
yarn create next-app
and the following responses:
√ Would you like to use TypeScript? ... No / Yes
√ Would you like to use ESLint? ... No / Yes
√ Would you like to use Tailwind CSS? ... No / Yes
√ Would you like to use `src/` directory? ... No / Yes
√ Would you like to use App Router? (recommended) ... No / Yes
√ Would you like to customize the default import alias? ... No / Yes
- Add sentry using
npx @sentry/wizard@latest -i nextjs
- Add http-server using
yarn add http-server
- In pages/index.js, remove everything related to 'next/image'
- Add the following to package.json under scripts:
"export": "next build && next export",
- Run
yarn dev
, navigate to /sentry-example-page, click the Throw error! button, and it will show up in sentry - Next run
yarn export
and thenhttp-server ./out
. Navigate to the same page and click the Throw error! button
Expected Result
I am expecting that sentry works when running nextjs as a static site. These issues seem to imply that it is possible:
However I could be wrong, and couldn't specifically verify in the documentation if sentry should work in this use case.
Actual Result
No result shows up in sentry. Instead, the static site is trying to make a call to the http-server, which unsurprisingly fails. I would have expected this to be handled on the client.
Metadata
Metadata
Assignees
Type
Projects
Status