Skip to content

What is SENTRY_SERVER_INIT_PATH? Why was it added automatically to .env? #3721

Closed
@Vadorequest

Description

@Vadorequest

Issue

This an issue with:

Platform/SDK documentation (Which one?)
https://docs.sentry.io/platforms/javascript/guides/nextjs/
Sentry Product (Which area?)
nextjs

Description

Running npx @sentry/wizard -i nextjs, I noticed the SENTRY_SERVER_INIT_PATH env variable has been added to my .env file automatically. (at least, I assume it did, because it came out of nowhere)

SENTRY_SERVER_INIT_PATH=.next/server/sentry/initServerSDK.js

This particular env var isn't documented anywhere and there is no explanation about what it does and why it's needed.

Suggested Solution

Explain what it is, so it doesn't come as a surprise when diffing local changes.


Also, I noticed it crashes during the build, too. (when running next dev)
It still continues the build, though, it's not a fatal error.

Error: Cannot find module '/Users/vadorequest/dev/NRN/v2-mst-aptd-at-lcz-sty/.next/server/sentry/initServerSDK.js'
Require stack:
- /Users/vadorequest/dev/NRN/v2-mst-aptd-at-lcz-sty/node_modules/@sentry/nextjs/dist/utils/instrumentServer.js
- /Users/vadorequest/dev/NRN/v2-mst-aptd-at-lcz-sty/node_modules/@sentry/nextjs/dist/index.server.js
- /Users/vadorequest/dev/NRN/v2-mst-aptd-at-lcz-sty/next.config.js
- /Users/vadorequest/dev/NRN/v2-mst-aptd-at-lcz-sty/node_modules/next/dist/next-server/server/config.js
- /Users/vadorequest/dev/NRN/v2-mst-aptd-at-lcz-sty/node_modules/next/dist/server/next.js
- /Users/vadorequest/dev/NRN/v2-mst-aptd-at-lcz-sty/node_modules/next/dist/server/lib/start-server.js
- /Users/vadorequest/dev/NRN/v2-mst-aptd-at-lcz-sty/node_modules/next/dist/cli/next-dev.js
- /Users/vadorequest/dev/NRN/v2-mst-aptd-at-lcz-sty/node_modules/next/dist/bin/next
[Sentry Webpack Plugin] Creating new release:
 'development'
[Sentry Webpack Plugin] Calling upload-sourcemaps with:
 {
  finalize: true,
  rewrite: true,
  dryRun: true,
  release: 'development',
  authToken: '',
  configFile: 'sentry.properties',
  stripPrefix: [ 'webpack://_N_E/' ],
  urlPrefix: '~/_next',
  include: [ '.next/' ],
  ignore: [
    '.next/cache',
    'server/ssr-module-cache.js',
    'static/*/_ssgManifest.js',
    'static/*/_buildManifest.js'
  ],
  debug: true
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions