Skip to content

Commit d52893c

Browse files
committed
feat(nuxt): Improve docs based on feedback
1 parent b65e408 commit d52893c

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

docs/platforms/javascript/common/troubleshooting/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ Learn more about fixing these caching issues in the <PlatformLink to="/sourcemap
459459
</PlatformSection>
460460
461461
<PlatformSection supported={['javascript.nuxt']}>
462-
<Expandable title="'import-in-the-middle' error during startup">
462+
<Expandable title="Failed to register 'import-in-the-middle' during build time">
463463
After adding `sentry.server.config.ts` and building the project, you might get an error like this:
464464
`Failed to register ESM hook import-in-the-middle/hook.mjs`. You can add an override (npm/pnpm) or a resolution (yarn)
465465
for `@vercel/nft` to fix this. This will add the `hook.mjs` file to your build output. See the [underlying issue in the UnJS Nitro project](https://github.com/unjs/nitro/issues/2703).
@@ -490,7 +490,7 @@ Learn more about fixing these caching issues in the <PlatformLink to="/sourcemap
490490
491491
</Expandable>
492492
493-
<Expandable permalink title="pnpm: Resolving 'import-in-the-middle' external package errors">
493+
<Expandable title="pnpm dev: Cannot find package 'import-in-the-middle'">
494494
495495
Sentry injects `import "import-in-the-middle/hook.mjs"` in your server entry. This import acts as a hint for node bundlers to really include this file.
496496
As pnpm implements a strict dependency isolation, this import might cause problems.

docs/platforms/javascript/guides/nuxt/manual-setup.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ Add a `sentry.client.config.ts` file to the root of your project (this is probab
8282
import * as Sentry from '@sentry/nuxt';
8383

8484
Sentry.init({
85-
// If set up, you can use your runtime config here
86-
// dsn: useRuntimeConfig().public.sentry.dsn,
85+
// If set up, you can use the Nuxt runtime config here
86+
// dsn: useRuntimeConfig().public.sentry.dsn, // modify, depending on your custom runtime config
8787
dsn: "___PUBLIC_DSN___",
8888

8989
// We recommend adjusting this value in production, or using tracesSampler
@@ -162,15 +162,18 @@ export default defineNuxtConfig({
162162
```
163163

164164
To upload source maps, the Sentry Nuxt Module will automatically enable source map generation in your project if it is not already enabled.
165-
However, you need to explicitly enable source map generation on the client-side. To do this, add the following code to your Nuxt configuration:
165+
However, you need to explicitly enable source map generation on the client-side.
166+
To do this, add the following code to your Nuxt configuration:
166167

167168
```javascript {filename:nuxt.config.ts} {2}
168169
export default defineNuxtConfig({
169-
sourcemap: { client: true }
170+
sourcemap: { client: 'hidden' }
170171
});
171172
```
172173

173-
This step is necessary because Nuxt sets default values for source maps ([Nuxt docs](https://nuxt.com/docs/api/nuxt-config#sourcemap)), and the Sentry Nuxt Module keeps these settings when they are explicitly defined.
174+
The option `'hidden'` works like `true`, but suppresses the source map reference comments that would be added to the end of each generated file in the build output.
175+
176+
Explicitly enabling client source maps is necessary because Nuxt sets default values for source maps ([Nuxt docs](https://nuxt.com/docs/api/nuxt-config#sourcemap)), and the Sentry Nuxt Module keeps these settings when they are explicitly defined.
174177

175178
## Verify
176179

0 commit comments

Comments
 (0)