Skip to content

Commit 19ef5bf

Browse files
Luca Forstnercoolguyzone
andauthored
Clarify esm restrictions (#13633)
Came up in https://discord.com/channels/621778831602221064/1369508106262020187 --------- Co-authored-by: Alex Krawiec <[email protected]>
1 parent 5f61ecf commit 19ef5bf

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

docs/platforms/javascript/common/install/esm-without-import.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ supported:
2121
When running your application in ESM mode, you will most likely want to <PlatformLink to="/install/esm">follow the ESM instructions</PlatformLink>. However, if you want to avoid using the `--import` command line option, for example if you have no way of configuring a CLI flag, you can also follow an alternative setup that involves importing the `instrument.mjs` file directly in your application.
2222

2323
<Alert level='warning' title='Restrictions of this installation method'>
24-
This installation method has fundamental restrictions:
25-
- Only basic `http` and `fetch` instrumentation will work.
26-
- No DB or framework-specific instrumentation will be available.
24+
25+
This installation method has the fundamental restriction that only native Node.js APIs can be instrumented (such as `fetch` and the `http` module).
26+
27+
As a result, the Sentry SDK will not capture data from database calls, queues, ORMs, third-party libraries, or other framework-specific data.
2728

2829
We recommend using this only if the `--import` flag is not an option for you.
2930

docs/platforms/javascript/guides/nuxt/install/limited-server-tracing.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ The automatically added top-level `import` will then import the Sentry server-si
1414
In this case, Sentry isn’t initialized before the app starts, but is set up as early as possible.
1515

1616
<Alert level='warning' title='Restrictions of this installation method'>
17-
This installation method has fundamental restrictions:
18-
- Only basic `http` and `fetch` instrumentation will work.
19-
- No DB or framework-specific instrumentation will be available.
2017

21-
We recommend using this only if the `--import` flag is not an option for you.
18+
This installation method has the fundamental restriction that only native Node.js APIs can be instrumented (such as `fetch` and the `http` module).
19+
As a result, the Sentry SDK will not capture data from database calls, queues, ORMs, third-party libraries, or other framework-specific data.
20+
21+
We recommend using this only if the `--import` flag is not an option for you.
22+
2223
</Alert>
2324

2425
## Initializing Sentry With a Top-level `import`
@@ -28,9 +29,9 @@ Enable the top-level `import` by setting `autoInjectServerSentry`:
2829
```typescript {filename:nuxt.config.ts} {3}
2930
export default defineNuxtConfig({
3031
sentry: {
31-
autoInjectServerSentry: 'top-level-import'
32+
autoInjectServerSentry: "top-level-import",
3233
},
33-
})
34+
});
3435
```
3536

3637
By default, the SDK will add the Sentry server config to the build output (typically, `.output/server/sentry.server.config.mjs`).

docs/platforms/javascript/guides/solidstart/install/limited-server-tracing.mdx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,30 @@ The automatically added top-level `import` will then import the Sentry server-si
1414
In this case, Sentry isn’t initialized before the app starts, but is set up as early as possible.
1515

1616
<Alert level='warning' title='Restrictions of this installation method'>
17-
This installation method has fundamental restrictions:
18-
- Only basic `http` and `fetch` instrumentation will work.
19-
- No DB or framework-specific instrumentation will be available.
2017

21-
We recommend using this only if the `--import` flag is not an option for you.
18+
This installation method has the fundamental restriction that only native Node.js APIs can be instrumented (such as `fetch` and the `http` module).
19+
As a result, the Sentry SDK will not capture data from database calls, queues, ORMs, third-party libraries, or other framework-specific data.
20+
21+
We recommend using this only if the `--import` flag is not an option for you.
22+
2223
</Alert>
2324

2425
## Initializing Sentry With a Top-level `import`
2526

2627
Enable the top-level `import` by setting `autoInjectServerSentry`:
2728

2829
```typescript {filename:app.config.ts} {8}
29-
import { defineConfig } from '@solidjs/start/config';
30-
import { withSentry } from '@sentry/solidstart';
30+
import { defineConfig } from "@solidjs/start/config";
31+
import { withSentry } from "@sentry/solidstart";
3132

32-
export default defineConfig(withSentry(
33+
export default defineConfig(
34+
withSentry(
3335
{},
3436
{
35-
autoInjectServerSentry: 'top-level-import'
36-
})
37-
);
37+
autoInjectServerSentry: "top-level-import",
38+
}
39+
)
40+
);
3841
```
3942

4043
By default, the SDK will add the Sentry server instrumentation file to the build output (typically, `.output/server/instrument.server.mjs`).

0 commit comments

Comments
 (0)