Title: Building without `sentry.properties` or env variables · Issue #3737 · getsentry/sentry-javascript · GitHub
Open Graph Title: Building without `sentry.properties` or env variables · Issue #3737 · getsentry/sentry-javascript
X Title: Building without `sentry.properties` or env variables · Issue #3737 · getsentry/sentry-javascript
Description: We are trying to implement the Sentry SDK in a Next.js project but are running into some problems. The situation is as follows: We have an open-source app in a public repository We build our app on GitHub Actions, without environment var...
Open Graph Description: We are trying to implement the Sentry SDK in a Next.js project but are running into some problems. The situation is as follows: We have an open-source app in a public repository We build our app on...
X Description: We are trying to implement the Sentry SDK in a Next.js project but are running into some problems. The situation is as follows: We have an open-source app in a public repository We build our app on...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/3737
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Building without `sentry.properties` or env variables","articleBody":"We are trying to implement the Sentry SDK in a Next.js project but are running into some problems.\r\nThe situation is as follows:\r\n\r\n- We have an open-source app in a public repository\r\n- We build our app on GitHub Actions, without environment variables, to then upload some components to [Chromatic](https://www.chromatic.com/) for visual review\r\n- We build our app once on Jenkins, without environment variables, and then run it on multiple environments (acceptance, testing, production) with different `.env` files. The fact that we build once and then run the same artifact on multiple environments (with different config) is important to our deployment and testing process.\r\n- To make the points above work, we exclusively use runtime config in our Next app, i.e. `publicRuntimeConfig` and `serverRuntimeConfig` which get filled with values from env variables coming from an `.env` file that gets set only on the actual servers that run the code.\r\n\r\nSince we added the `@sentry/nextjs` package to our app, this approach is broken because apparently the `sentry.properties` file (which contains a secret and thus cannot be committed in our git repo) or the alternative env variables are required at _build_ time. If I understand correctly this is required at build time because that's the moment that `sentry-cli` uploads source maps to Sentry.\r\n\r\nWe could add the required env variables as secrets to our GitHub repository and to Jenkins, but ideally we would just want to disable the `sentry-cli` step and source map uploads, and work with public source maps instead.\r\n\r\nThe only part of the Nextjs SDK that we want to use is the webpack plugin that loads the file with the `Sentry.init()` as soon as possible. (Or a suitable alternative to that)\r\n\r\nWhat would be the best/easiest way to achieve this? I don't see an option to disable `sentry-cli` and source maps in https://github.com/getsentry/sentry-webpack-plugin#options\r\n\r\nIs there another way to have Next call the `Sentry.init` as soon as possible?","author":{"url":"https://github.com/bertramakers","@type":"Person","name":"bertramakers"},"datePublished":"2021-06-23T11:04:35Z","url":"https://github.com/getsentry/sentry-javascript/issues/3737"}
| 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:545df376-1a54-509a-08c8-f68f1f66a802 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8280:46A3B:17244E:204013:6B0465A9 |
| html-safe-nonce | d3ddced38e06c8665de793259f794792b8b965c366dbba4a69f1d037f00746ca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjgwOjQ2QTNCOjE3MjQ0RToyMDQwMTM6NkIwNDY1QTkiLCJ2aXNpdG9yX2lkIjoiNDkyMjYyNTI2Mjg1ODAzNjY0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 934debab61cf2c20c98fb7821bc0e5c49d75e6c058db8bea15f09ed0ecd70052 |
| hovercard-subject-tag | issue:928135973 |
| 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/3737/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9ddeab9105bf06fafde151a290f92f96937e4c498b4108c9972e054b584c3cc8/getsentry/sentry-javascript/issues/3737 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9ddeab9105bf06fafde151a290f92f96937e4c498b4108c9972e054b584c3cc8/getsentry/sentry-javascript/issues/3737 |
| og:image:alt | We are trying to implement the Sentry SDK in a Next.js project but are running into some problems. The situation is as follows: We have an open-source app in a public repository We build our app on... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bertramakers |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| 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 | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| 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