getsentry / sentry-javascript-bundler-plugins

JavaScript Bundler Plugins for Sentry
https://sentry.io
BSD 3-Clause "New" or "Revised" License
143 stars 37 forks source link

.sentryclirc not working after upgrading to webpackplugin 2.x #458

Closed gsouf closed 10 months ago

gsouf commented 10 months ago

Environment

"@sentry/webpack-plugin": "2.10.2",

Steps to Reproduce

Build with webpack with the sentry plugin enabled and .sentryclirc file like this one:

[defaults]
org=xxx
project=xxx

[auth]
token=xxx

Expected Result

Will upload the source map to sentry

Actual Result

Get the following error:

[sentry-webpack-plugin] Warning: No auth token provided. Will not create release. Please set the `authToken` option.

It used to work before version 2.x. I suppose something has changed and is not covered in the migration guide.

Note that even after deleting the file and re-creating it using sentry login it's still not working.

lforst commented 10 months ago

Hi, thanks for writing in. We indeed removed the ability to pass in an auth token via .sentryclirc. Some more context: https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/332

We should have put this into the migration guide. I will open a PR to address this! Sorry for the inconvenience. For now, please pass the auth token via an environment variable, pass it to the authToken option, or use a configuration file.

gsouf commented 10 months ago

@lforst thanks that make sense. Just so you know: when you run sentry-cli login it will add the auth token to the dot file as well. Might as well be removed.

lforst commented 10 months ago

@gsouf The dotfile still has a purpose when being used with sentry-cli directly. We wanted to separate sentry-cli and our Webpack plugin conceptually from each other, because it lead to some funky UX. Just don't think of sentry-cli as related to the webpack plugin an longer.