Code Monkey home page Code Monkey logo

Comments (7)

seanparmelee avatar seanparmelee commented on June 18, 2024 1

Thanks @AbhiPrasad & @lforst, it sounds like disabling the entire plugin would not be in our best interest.

I confirmed adding

release: {
  create: false,
}

resolves the aforementioned error. We could probably also make the auth token escape hatch work. We certainly don't need to have the token set locally, but would have to tweak our CI/CD pipeline to make sure it's not set when doing something like deploying a PR. When I tested it locally, I noticed it does add some noise to the output though (warning numerous times about the auth token not being provided). Interestingly enough, it emits these warnings even when the options for disabling source maps and releases are passed, which seems unnecessary since the intention is to not perform those tasks anyway. Think it's worth logging an issue for this?

[@sentry/nextjs - Node.js] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[@sentry/nextjs - Node.js] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/

In any case, I have a path forward so I think we can close this issue out. Thanks again for your help!

from sentry-javascript.

lforst avatar lforst commented on June 18, 2024 1

Interestingly enough, it emits these warnings even when the options for disabling source maps and releases are passed, which seems unnecessary since the intention is to not perform those tasks anyway.

That is a very fair point. We will fix this!

from sentry-javascript.

AbhiPrasad avatar AbhiPrasad commented on June 18, 2024

You should be able to disable sourcemaps via sourcemaps.disable.

export default withSentryConfig(nextConfig, {
  sourcemaps: {
    disable: true,
  },
});

Does this suffice for what you are looking for?

from sentry-javascript.

seanparmelee avatar seanparmelee commented on June 18, 2024

You should be able to disable sourcemaps via sourcemaps.disable.

export default withSentryConfig(nextConfig, {
  sourcemaps: {
    disable: true,
  },
});

Does this suffice for what you are looking for?

Hi @AbhiPrasad, this is what I first tried, but when I run next build on my local machine it fails with:

unhandledRejection Error: Command failed: /Users/sean.parmelee/Projects/voltron-app/node_modules/.pnpm/@[email protected]/node_modules/@sentry/cli-darwin/bin/sentry-cli releases new BADIDEA5
error: API request failed
  caused by: sentry reported an error: Invalid token (http status: 401)

So it seems the plugin still tries to create a release in this case and we don't want that to happen unless it's part of our CI/CD flow.

from sentry-javascript.

AbhiPrasad avatar AbhiPrasad commented on June 18, 2024

Ah gotcha.

you can do

export default withSentryConfig(nextConfig, {
  release: {
    create: false,
  },
});

to prevent the release from being created. @lforst does it makes sense for us to introduce an option that just turns everything off entirely?

from sentry-javascript.

lforst avatar lforst commented on June 18, 2024

@AbhiPrasad Yeah I think this is not asking for too much. We could add something like disableSentryWebpackPlugin, however, that will also disable things like the react component annotation. This changes my thought process around this a bit. Generally speaking, if authToken is not defined, and there is also no SENTRY_AUTH_TOKEN environment variable present, the plugin will not attempt to do anything in Sentry. Is it possible that this is enough of an escape hatch? I think something like disableSentryWebpackPlugin might be confusing. Sorry for the stream of consciousness lol

from sentry-javascript.

seanparmelee avatar seanparmelee commented on June 18, 2024

I guess I missed this earlier because I was getting a separate build error (related to the @sentry/fullstory plugin), but I found out I also need to set release.finalize = false because it was trying to finalize the release as well.

Starting to wonder if it's better to just go the route of making sure the auth token isn't set (and live with the warnings) so it doesn't end up adding the releaseManagementPlugin 🤔

from sentry-javascript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.