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 #712

Open
mdwyer-od opened this issue Jan 13, 2025 · 0 comments
Labels

Comments

@mdwyer-od
Copy link

Version

@nuxtjs/sentry: 8.0.8
nuxt: 2.17.3

Sentry configuration

    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/**']
      }
    },

Reproduction Link

Basic reproduction repo

Steps to reproduce

Run npm run generate in the reproduction project

What is Expected?

Sourcemaps are uploaded to Sentry

What is actually happening?

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:

[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.

I thought perhaps this was a webpack problem and asked in the webpack plugin project, but was redirected over here.

@mdwyer-od mdwyer-od added the bug label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant