Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
@sentry/nextjs
Version:
6.5.1
Description
I use Github Actions to build my nextjs application, then deploy artifacts to a NodeJS Server hosted elsewhere.
https://nextjs.org/docs/deployment#nodejs-server
During npm run build
@sentry/nextjs creates a file .env.local and sets an environment variable SENTRY_SERVER_INIT_PATH. The value of said variable is an absolute path i.e. C:\some_path_to_project\.next\server\sentry\initServerSDK.js
During npm run start
process.env.SENTRY_SERVER_INIT_PATH is used to require initServerSDK.js. However, npm run start
is called after artifacts have been uploaded to a different environment running a NodeJS server. Because of this, the absolute path of process.env.SENTRY_SERVER_INIT_PATH is no longer valid.
initServerSDK.js cannot be found and Sentry.Init() is never called - serverside logging does not happen.
Source code