Skip to content

Commit 39bf44b

Browse files
committed
add information regarding nft resolution
1 parent 0504631 commit 39bf44b

File tree

1 file changed

+20
-1
lines changed
  • docs/platforms/javascript/common/deployment-provider-setup

1 file changed

+20
-1
lines changed

docs/platforms/javascript/common/deployment-provider-setup/general.mdx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,25 @@ However, some deployment providers use custom node bundlers that might not inclu
5050
This is often done by tracing the node files and only including the necessary dependencies. Since Sentry has to include the `hook.mjs` file internally with `module.register()` it might not be discovered by some bundlers and therefore not included.
5151
If you get a warning that the `hook.mjs` file is not found, please report this in [the Sentry JS GitHub repo](https://github.com/getsentry/sentry-javascript/issues) or file an issue at your deployment provider.
5252

53+
Nitro (which is used by Nuxt and SolidStart on the server side) uses [`@vercel/nft`](https://github.com/vercel/nft) during the build. `@vercel/nft` includes files that are added with `module.register()` from version 0.27.4 onwards.
54+
In case you get a runtime error along the lines `Cannot find module '/node_modules/import-in-the-middle/hook.mjs'`, make sure to add a resolution (yarn) or an override (npm/pnpm) for `@vercel/nft`:
55+
56+
```json {tabTitle:yarn} {filename: package.json}
57+
{
58+
"resolutions": {
59+
"@vercel/nft": "^0.27.4"
60+
}
61+
}
62+
```
63+
64+
```json {tabTitle:npm/pnpm} {filename: package.json}
65+
{
66+
"overrides": {
67+
"@vercel/nft": "^0.27.4"
68+
}
69+
}
70+
```
71+
5372
## Setup other environment variables
5473

5574
In case you are using environment variables in your project to set up Sentry don't forget to also add them inside your deployment environment:
@@ -61,7 +80,7 @@ SENTRY_AUTH_TOKEN="___ORG_AUTH_TOKEN___"
6180

6281

6382

64-
## Troubleshooting
83+
## Exclude modules from import-in-the-middle
6584

6685
As all packages are wrapped under the hood by [import-in-the-middle](https://www.npmjs.com/package/import-in-the-middle), you might run into issues with certain packages. If you run into a problem with a package, you can skip instrumentation for it by configuring `registerEsmLoaderHooks` in your `Sentry.init()` config.
6786

0 commit comments

Comments
 (0)