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: platform-includes/getting-started-config/javascript.nuxt.mdx
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,8 +77,11 @@ dotenv.config();
77
77
78
78
After adding `sentry.server.config.ts` and building the project, you might get an error like this:
79
79
`Failed to register ESM hook import-in-the-middle/hook.mjs`. You can add an override (npm/pnpm) or a resolution (yarn)
80
-
for `@vercel/nft` to fix this. This will add the `hook.mjs` file to your build output.
81
-
See the [underlying issue in the UnJS Nitro project](https://github.com/unjs/nitro/issues/2703).
80
+
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).
81
+
82
+
83
+
Nitro updated `@vercel/nft` in Nitro version `2.10.0`, so you might not get this error anymore, and you don't need to
84
+
add this override/resolution.
82
85
83
86
```json {tabTitle:npm} {filename:package.json}
84
87
"overrides": {
@@ -99,3 +102,17 @@ See the [underlying issue in the UnJS Nitro project](https://github.com/unjs/nit
99
102
}
100
103
}
101
104
```
105
+
106
+
**Pnpm and Import-In-The-Middle**
107
+
108
+
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.
109
+
As pnpm implements a strict dependency isolation, this import might cause problems.
110
+
Per default, `shamefully-hoist` is `false` ([pnpm docs here](https://pnpm.io/next/npmrc#shamefully-hoist)) and this prevents accessing non-declared dependencies.
111
+
You probably don't want to change this setting, so you have to explicitly add the dependency `import-in-the-middle`:
0 commit comments