Title: Incorrect error message received when Sentry DSN not provided · Issue #12040 · getsentry/sentry-javascript · GitHub
Open Graph Title: Incorrect error message received when Sentry DSN not provided · Issue #12040 · getsentry/sentry-javascript
X Title: Incorrect error message received when Sentry DSN not provided · Issue #12040 · 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/12040
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect error message received when Sentry DSN not provided","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\r\n- [X] I have reviewed the documentation https://docs.sentry.io/\r\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\r\n\r\n### How do you use Sentry?\r\n\r\nSentry Saas (sentry.io)\r\n\r\n### Which SDK are you using?\r\n\r\n@sentry/node\r\n\r\n### SDK Version\r\n\r\n8.0.0\r\n\r\n### Framework Version\r\n\r\nExpress 4.17.17\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### SDK Setup\r\n\r\n```javascript\r\nSentry.init({\r\n enabled: true,\r\n dsn: process.env.NODE_ENV === \"production\" ? process.env.SENTRY_DSN : \"\",\r\n debug: process.env.NODE_ENV !== \"production\" ? true : false,\r\n release: process.env.npm_package_version,\r\n environment: process.env.NODE_ENV,\r\n sampleRate: 0.5,\r\n maxBreadcrumbs: 100,\r\n sendClientReports: true,\r\n integrations: [nodeProfilingIntegration()],\r\n tracesSampleRate: 0.5,\r\n profilesSampleRate: 0.5,\r\n});\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\n1. Run **dev** environment where DSN is not provided (in order to not spam Sentry with bugs in dev)\r\n2. Observe message in console: `[Sentry] Express is not instrumented. This is likely because you required/imported express before calling Sentry.init().`\r\n3. I have confirmed I am importing files in the correct order and using `Sentry.setupExpressErrorHandler(app);`.\r\n4. When providing a DSN in **dev**, the \"not instrumented\" message is not sent, and Sentry works and logs events as expected.\r\n\r\n\r\n### Expected Result\r\n\r\nI should only see: \r\n`Sentry Logger [warn]: No DSN provided, client will not send events.` \r\nmessage in the console, and not the: \r\n`[Sentry] Express is not instrumented. This is likely because you required/imported express before calling `Sentry.init()`.`\r\nmessage, if my app is set up correctly.\r\n\r\n### Actual Result\r\n\r\n\u003cimg width=\"1250\" alt=\"image\" src=\"https://github.com/getsentry/sentry-javascript/assets/52798353/33c00798-0e7e-429f-a0f1-df7db9d4da49\">\r\n","author":{"url":"https://github.com/whitep4nth3r","@type":"Person","name":"whitep4nth3r"},"datePublished":"2024-05-15T08:55:44Z","url":"https://github.com/getsentry/sentry-javascript/issues/12040"}
| 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:3bc3e74b-1ec1-e116-6e3c-4a3a4f70d422 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECF4:114F4B:30C39C:438934:6B04554F |
| html-safe-nonce | 9e74e4f0475fb325492ced77e6987f6a8bf4c2ef3adac93bab6a00f87fccd183 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0Y0OjExNEY0QjozMEMzOUM6NDM4OTM0OjZCMDQ1NTRGIiwidmlzaXRvcl9pZCI6IjkxMDc1ODY4MzI4MTU5MDQwODAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d938ce42b8f0c0d9cdd5ff9456a132afe7f16abcd47fe397c028277391b10979 |
| hovercard-subject-tag | issue:2297269438 |
| 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/12040/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c701a2de24b0320e1b9385677f759bbb8fc0a4bb3e21e5fe67c02da56f1bc4e4/getsentry/sentry-javascript/issues/12040 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c701a2de24b0320e1b9385677f759bbb8fc0a4bb3e21e5fe67c02da56f1bc4e4/getsentry/sentry-javascript/issues/12040 |
| 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 | whitep4nth3r |
| hostname | github.com |
| expected-hostname | github.com |
| None | 910ca0e260cfec6aff11407d8dc6a0d3a4cd381a2ec9ada56627b063426892a0 |
| 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 | e086f9b7e88322eb2b41885a6ad425b215737fa5 |
| 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