Title: Sentry doesn't log on nextjs13 frontend side · Issue #6763 · getsentry/sentry-javascript · GitHub
Open Graph Title: Sentry doesn't log on nextjs13 frontend side · Issue #6763 · getsentry/sentry-javascript
X Title: Sentry doesn't log on nextjs13 frontend side · Issue #6763 · getsentry/sentry-javascript
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/...
Open Graph 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 th...
X 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 th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/6763
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sentry doesn't log on nextjs13 frontend side","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which package are you using?\n\n@sentry/nextjs\n\n### SDK Version\n\n7.30.0\n\n### Framework Version\n\n\"next\": \"13.1.1\"\n\n### Link to Sentry event\n\n_No response_\n\n### Steps to Reproduce\n\n### My `next.config.js`\r\n\r\n```\r\nconst path = require('path');\r\n/** @type {import('next').NextConfig} */\r\nconst { withSentryConfig } = require('@sentry/nextjs');\r\n\r\nconst nextConfig = {\r\n reactStrictMode: false,\r\n swcMinify: true,\r\n output: 'standalone',\r\n experimental: {\r\n appDir: true,\r\n serverComponentsExternalPackages: ['prisma', '@prisma/client'],\r\n },\r\n sentry: {\r\n hideSourceMaps: false,\r\n },\r\n};\r\n\r\nmodule.exports = withSentryConfig(nextConfig);\r\n\r\n```\r\n\r\n### `sentry.client.config.js`\r\n\r\n```js\r\nimport * as Sentry from '@sentry/nextjs';\r\n\r\nconst SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;\r\n\r\nSentry.init({\r\n dsn: SENTRY_DSN,\r\n tracesSampleRate: 1.0,\r\n});\r\n\r\n```\r\n\r\n\r\n### `sentry.server.config.js`\r\n\r\n```js\r\nimport * as Sentry from '@sentry/nextjs';\r\n\r\nconst SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;\r\n\r\nSentry.init({\r\n dsn: SENTRY_DSN,\r\n tracesSampleRate: 1.0,\r\n});\r\n\r\n```\r\n\r\n### `sentry.properties`\r\n\r\n```properties\r\ndefaults.url=https://sentry.io/\r\ndefaults.org=my-org\r\ndefaults.project=my-project-name\r\ncli.executable=node_modules/@sentry/cli/bin/sentry-cli\r\n```\r\n\r\n### `.sentryclirc`\r\n\r\n```sentryclirc\r\n[auth]\r\ntoken=SENTRY_AUTH_TOKEN\r\n```\r\n\r\n### `app/error.tsx`\r\n\r\n```tsx\r\n'use client';\r\nimport { useEffect } from 'react';\r\nimport * as Sentry from '@sentry/nextjs';\r\n\r\nexport default function Error({\r\n error,\r\n reset,\r\n}: {\r\n error: Error;\r\n reset: () => void;\r\n}) {\r\n const reportSentry = async (error: Error) => {\r\n console.log('🚀🚀🚀 ~ reportSentry ~ error', error);\r\n await Sentry.captureException(error);\r\n };\r\n\r\n useEffect(() => {\r\n // Log the error to an error reporting service\r\n console.error('TOP LEVEL ERROR', error);\r\n reportSentry(error);\r\n }, [error]);\r\n\r\n return (\r\n \u003cdiv>\r\n \u003ch1>\r\n Something wrong happened.\r\n \u003c/h1>\r\n \u003c/div>\r\n );\r\n}\r\n\r\n```\r\n\r\n### Finally `app/test/page.tsx`\r\n\r\n```tsx\r\n'use client';\r\nexport default function Page() {\r\n return (\r\n \u003c>\r\n \u003ch1>Hello, Test page\u003c/h1>\r\n \u003cbutton\r\n onClick={() => {\r\n throw Error('From test'); // error in console but not in Sentry\r\n }}\r\n >\r\n Throw error\r\n \u003c/button>\r\n \u003c/>\r\n );\r\n}\r\n\r\n```\r\n\r\n\r\nI already have setted my env vars`NEXT_PUBLIC_SENTRY_DSN`, `SENTRY_AUTH_TOKEN`, `SENTRY_ORG`, `SENTRY_PROJECT` but doesn't work.\r\n\n\n### Expected Result\n\nLogged error on sentry\n\n### Actual Result\n\nNo logged nothing on sentry.","author":{"url":"https://github.com/fernandops26","@type":"Person","name":"fernandops26"},"datePublished":"2023-01-13T00:49:36Z","url":"https://github.com/getsentry/sentry-javascript/issues/6763"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3087f164-f7f1-984f-46db-23ffeb8200a0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B83C:3F7031:3580F1:49E858:6B044F2A |
| html-safe-nonce | 16c2b71714c4c5a32b92be4fa40e45caa1d6f546828768b5fa2e1a9529eeec9a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODNDOjNGNzAzMTozNTgwRjE6NDlFODU4OjZCMDQ0RjJBIiwidmlzaXRvcl9pZCI6IjgxNjQ1MjI2MzU3OTE5NzgyODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 79ac4edafdcf6382286cb57c75c089c145c787c84c942060ba0aee76b434539d |
| hovercard-subject-tag | issue:1531547045 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/6763/issue_layout |
| twitter:image | https://opengraph.githubassets.com/293de46ff4a88a2c9bbf2a9b7f0369214a54667ce3876f91a950b0aad82874a7/getsentry/sentry-javascript/issues/6763 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/293de46ff4a88a2c9bbf2a9b7f0369214a54667ce3876f91a950b0aad82874a7/getsentry/sentry-javascript/issues/6763 |
| og:image:alt | 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 th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fernandops26 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 002aa6b95ffa730b0aec436a5c383f536ad677284e60056037fb120afe37b730 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 059f24c781e3a0d7df3f27a97da0e93fab06ae39 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width