Commit 40c4967
committed
fix(nextjs): Inject _sentrySpotlight via globalThis for reliable Spotlight auto-enablement
The valueInjectionLoader now injects both NEXT_PUBLIC_SENTRY_SPOTLIGHT and
_sentrySpotlight into globalThis. This provides a reliable fallback chain:
1. globalThis.NEXT_PUBLIC_SENTRY_SPOTLIGHT - primary (valueInjectionLoader)
2. process.env._sentrySpotlight - fallback (Next.js env config replacement)
3. globalThis._sentrySpotlight - final fallback (valueInjectionLoader)
This ensures Spotlight auto-enablement works in Next.js 15 Turbopack dev mode
where Next.js doesn't reliably replace process.env values in node_modules code.
Also adds _sentrySpotlight to the env config buildTimeVariables for build-time
replacement in production builds.1 parent b16f01d commit 40c4967
File tree
4 files changed
+19
-6
lines changed- packages/nextjs/src
- client
- config
- turbopack
4 files changed
+19
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
153 | | - | |
154 | | - | |
155 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
156 | 158 | | |
157 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
158 | 162 | | |
159 | 163 | | |
160 | 164 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
| 773 | + | |
773 | 774 | | |
| 775 | + | |
774 | 776 | | |
775 | 777 | | |
776 | 778 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | | - | |
627 | | - | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
628 | 633 | | |
629 | 634 | | |
630 | 635 | | |
| |||
0 commit comments