You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+45-1
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,51 @@
10
10
11
11
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
12
12
13
-
Work in this release was contributed by @aloisklink, @arturovt, @benjick and @maximepvrt. Thank you for your contributions!
13
+
Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, and @kunal-511. Thank you for your contributions!
14
+
15
+
-**feat(solidstart)!: Default to `--import` setup and add `autoInjectServerSentry` ([#14862](https://github.com/getsentry/sentry-javascript/pull/14862))**
16
+
17
+
To enable the SolidStart SDK, wrap your SolidStart Config with `withSentry`. The `sentrySolidStartVite` plugin is now automatically
18
+
added by `withSentry` and you can pass the Sentry build-time options like this:
With the `withSentry` wrapper, the Sentry server config should not be added to the `public` directory anymore.
40
+
Add the Sentry server config in `src/instrument.server.ts`. Then, the server config will be placed inside the server build output as `instrument.server.mjs`.
41
+
42
+
Now, there are two options to set up the SDK:
43
+
44
+
1.**(recommended)** Provide an `--import` CLI flag to the start command like this (path depends on your server setup):
2. Add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry (comes with tracing limitations)
47
+
```js
48
+
withSentry(
49
+
{
50
+
/* Your SolidStart config options... */
51
+
},
52
+
{
53
+
// Optional: Install Sentry with a top-level import
**`sentry.client.config.ts|js` is still supported and encouraged for initializing the clientside SDK.**
873
+
Version 8 of the Next.js SDK will require an additional `instrumentation.ts` file to execute the `sentry.server.config.js|ts` and `sentry.edge.config.js|ts` modules to initialize the SDK for the server-side.
874
+
The `instrumentation.ts` file is a Next.js native API called [instrumentation hook](https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation).
877
875
878
-
The following is an example of how to initialize the serverside SDK in a Next.js instrumentation hook:
876
+
To start using the Next.js instrumentation hook, follow these steps:
879
877
880
-
1. First, enable the Next.js instrumentation hook by setting the `experimental.instrumentationHook` to `true` in your
881
-
`next.config.js`.
882
-
2. Next, create a `instrumentation.ts|js` file in the root directory of your project (or in the `src` folder if you have
883
-
have one).
884
-
3. Now, export a `register` function from the `instrumentation.ts|js` file and call `Sentry.init()` inside of it:
878
+
1. First, enable the Next.js instrumentation hook by setting the [`experimental.instrumentationHook`](https://nextjs.org/docs/app/api-reference/next-config-js/instrumentationHook) to true in your `next.config.js`. (This step is no longer required with Next.js 15)
885
879
886
-
```ts
887
-
import*asSentryfrom'@sentry/nextjs';
888
-
889
-
exportfunctionregister() {
890
-
if (process.env.NEXT_RUNTIME==='nodejs') {
891
-
Sentry.init({
892
-
dsn:'YOUR_DSN',
893
-
// Your Node.js Sentry configuration...
894
-
});
895
-
}
896
-
897
-
if (process.env.NEXT_RUNTIME==='edge') {
898
-
Sentry.init({
899
-
dsn:'YOUR_DSN',
900
-
// Your Edge Runtime Sentry configuration...
901
-
});
902
-
}
880
+
```JavaScript {filename:next.config.js} {2-4}
881
+
module.exports= {
882
+
experimental: {
883
+
instrumentationHook:true, // Not required on Next.js 15+
884
+
},
903
885
}
904
886
```
905
887
906
-
If you need to import a Node.js specific integration (like for example `@sentry/profiling-node`), you will have to
907
-
import the package using a dynamic import to prevent Next.js from bundling Node.js APIs into bundles for other
908
-
runtime environments (like the Browser or the Edge runtime). You can do so as follows:
888
+
2. Next, create a `instrumentation.ts|js` file in the root directory of your project (or in the src folder if you have have one).
889
+
890
+
3. Now, export a register function from the `instrumentation.ts|js` file and import your `sentry.server.config.js|ts` and `sentry.edge.config.js|ts` modules:
Copy file name to clipboardExpand all lines: dev-packages/browser-integration-tests/suites/integrations/moduleMetadata/appliesMetadataWithRewriteFrames/init.js
0 commit comments