-
-
Couldn't load subscription status.
- Fork 1.7k
Open
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
9.2.0
Framework Version
Next 15.2.0
Link to Sentry event
Reproduction Example/SDK Setup
GitHub repo: https://github.com/cau777/temp-sentry-nextjs-localvars
Steps to Reproduce
- Create a NextJS project using create-next-app:
npx create-next-app@latest temp-sentry-nextjs-localvars - Install Sentry with the wizard:
npx @sentry/wizard@latest -i nextjs - Add
includeLocalVariables: truetosentry.server.config.ts - Implement a test function under
pages/api, for example:
const willThrow = () => {
const hey = 12
const value = 1
const str = "some string"
console.log(hey, value, str)
throw new Error("Intentional error on Sentry reproduction 3")
}
export default function handler(_req, res) {
try {
willThrow()
} catch (e) {
captureException(e)
}
res.status(200).json({ name: "John Doe" });
}- Upload the project to a git repo and deploy to Vercel
- Add
SENTRY_AUTH_TOKENto the env variables in Vercel
Expected Result
When navigating to the test API route on the deployed app, an error should be reported to Sentry, containing all 3 local variables from the willThrow function.
Actual Result
No local variables appear in the Sentry issue when the app is deployed on Vercel.
However, running the same code locally npm run dev reports local variables to Sentry as expected.
Vercel apps are deployed on AWS Lambda, maybe the debugger used by Sentry to extract local variables doesn't work in that environment?
nicolassanmar
Metadata
Metadata
Assignees
Projects
Status
No status

