getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.94k stars 1.56k forks source link

Vercel: Auth token not provided causes failed deploy #4383

Closed D-Pagey closed 2 years ago

D-Pagey commented 2 years ago

Environment

Steps to Reproduce

yarn build locally works fine 🛑 yarn build on Vercel fails due to auth token

Expected Result

Actual Result

Screenshot 2021-12-13 at 10 12 30

Questions

kamilogorek commented 2 years ago

This is some misconfiguration issue in @sentry/next setup, so moving it to appropriate repo.

lobsterkatie commented 2 years ago

Hi, @D-Pagey!

Sorry you're having trouble. This is curious to me. It's easily fixable but I'd like to understand it first. We automatically pick up the SENTRY_AUTH_TOKEN env variable, as you can see here, but not one with NEXT_PUBLIC at the beginning.

Where are you setting the environment variable which is causing the prefix to be added? (Or did you name it that way yourself?)

github-actions[bot] commented 2 years ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

MartinSeeler commented 2 years ago

Just in case someone finds its way via Google here, I had the same issue. Connected Vercel and Sentry via UI and ran into this error.

It took some time to discover, that the integration has set up everything correctly, but the environment variables in Vercel were set to production only, which caused the build on preview fail.

image

pfcodes commented 2 years ago

Docs should be updated to make this clear. Will update if I find time and no one else has gotten around to it by then.

sshah98 commented 2 years ago

@MartinSeeler's solution worked for me! Basically need to add to the webpack config in next.config.js and then add it to the vercel environment variables!