Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry tries to upload sourcemaps before build completes - [sentry-webpack-plugin] Warning: Didn't find any matching sources for debug ID upload #620

Open
mdwyer-od opened this issue Oct 18, 2024 · 5 comments

Comments

@mdwyer-od
Copy link

mdwyer-od commented Oct 18, 2024

Environment

@sentry/webpack-plugin: 2.22.5
@nuxtjs/sentry: 8.0.8
@sentry/core: 7.119.2
nuxt: 2.17.3

Steps to Reproduce

sentry: {
    dsn: <dsn>,
    disabled: false,
    config: {
      environment: process.env.ENV,
      release: process.env.npm_package_version,
      autoSessionTracking: false,
      debug: false,
      attachStacktrace: true
    },
    publishRelease: isDevelopmentMode ? false : {
      authToken: process.env.SENTRY_AUTH_TOKEN,
      url: <url>,
      org: <org>,
      project: <project>,
      debug: true,
      sourcemaps: {
        assets: [`./dist/**/*`],
        ignore: ['./node_modules/**']
      }
    },

Expected Result

Sourcemaps are uploaded to Sentry.

Actual Result

Sentry appears to be trying to upload sourcemaps before the nuxt generate command completes. We use Github Actions to build the app. Here's the GA output:

> nuxt generate && mv ./dist/assets/* dist/ && rmdir ./dist/assets
[success] [nuxt:sentry] Sentry reporting is enabled (client side: enabled, server side: enabled)
[info] Production build
[info] Bundling only for client side
[info] Target: static
[success] Builder initialized
[success] Nuxt files generated
Error:  [BABEL] Note: The code generator has deoptimised the styling of /runner/_work/<thing>/<thing>/services/<api>/<sdk>/api.ts as it exceeds the max of 500KB.
[log] [sentry-webpack-plugin] Warning: Didn't find any matching sources for debug ID upload. Please check the `sourcemaps.assets` option.
[success] [nuxt:sentry] Sentry reporting is enabled (client side: enabled, server side: enabled)
[info] Generating output directory: dist/
[info] Generating pages
[success] Generated route "/"
[success] Client-side fallback created: `200.html`
> <project>@<version> generate-sitemap
> node ./pipeline/sitemap-gen.js
fetching current sitemap.xml
fetching published product ids...
generating sitemap.xml
done

As you can see, the webpack plugin does not does not find the sources, which I believe is because the generate command hasn't finished building yet. I added a few echo statements in the command on the first line to be sure (removed here). Have I configured something incorrectly? This is part of an upgrade from the 1.x version of the plugin, and sourcemap upload seemed to work before.

Additionally, the command works locally on my machine. The build generates all files and sourcemaps, and uploads correctly to Sentry once the build completes. I'm unsure why the same command would work locally, but fail in Github Actions. Any help would be appreciated, thank you.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Oct 18, 2024
@lforst
Copy link
Member

lforst commented Oct 21, 2024

Hi, thanks for writing in! Can you please share a complete reproduction setup so we can debug this effectively? Thanks!

In addition to the repro, why are you using the webpack plugin + the nuxt SDK? Nuxt is vite right?

@mdwyer-od
Copy link
Author

@lforst Nuxt can be used with webpack, as that's how this project was initially set up. I hope to move to Vite soon, but this is how I'm stuck for now.

What do you require for a complete reproduction? Does it need to be on something like codepen, or will supplying files directly here suffice?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Oct 21, 2024
@lforst
Copy link
Member

lforst commented Oct 21, 2024

Something that we could run would be great.

@mdwyer-od
Copy link
Author

@lforst here's a basic reproduction of my setup. Though, when plugging in all my Sentry details, it doesn't seem to generate sourcemaps at all in Github. Locally, it works correctly generating sourcemaps and uploading them. I'm unsure why it's different, and I don't believe I'm missing any variables. Perhaps my Sentry configuration is incorrect in some way. I'll continue to look, but this should at least get you started.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Oct 21, 2024
@lforst
Copy link
Member

lforst commented Oct 22, 2024

It seems like you added the @sentry/webpack-plugin dependency but you're not using it anywhere. As far as I can see you are using @nuxtjs/sentry to upload sourcemaps which is not maintained by Sentry but the community. I recommend you raise an issue there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Community
Development

No branches or pull requests

3 participants