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

fix: sourcemaps not uploading to Sentry #424

Merged
merged 3 commits into from
Jan 21, 2025
Merged

Conversation

cristianoventura
Copy link
Collaborator

Description

This PR fixes an issue where sourcemaps were not being uploaded to Sentry during a release.

When looking at the release logs we can see the following warning:

[sentry-vite-plugin] Warning: No project provided. Will not create release. Please set the `project` option to your Sentry project slug.

We can also see that the SENTRY_PROJECT and SENTRY_ORG variables are not being read properly from the repo settings:

SENTRY_DSN: ***
SENTRY_AUTH_TOKEN: ***
SENTRY_ORG:
SENTRY_PROJECT:

This caused @sentry/vite-plugin not to know which Sentry project to associate the sourcemaps with.

How to Test

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (npm run lint) and all checks pass.
  • I have run tests locally (npm test) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Screenshots (if appropriate):

Related PR(s)/Issue(s)

@cristianoventura cristianoventura self-assigned this Jan 20, 2025
@cristianoventura cristianoventura requested a review from a team as a code owner January 20, 2025 18:23
Comment on lines +71 to +72
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the main issue

@@ -21,8 +22,16 @@ export default defineConfig((env) => {
assetFileNames: '[name].[ext]',
},
},
sourcemap: true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also noticed that sourcemaps were configured to be uploaded only for the main process so I added the same config for preload and renderer as well.

sourcemap: true,

Copy link
Member

@Llandy3d Llandy3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@cristianoventura cristianoventura merged commit 67d4d1a into main Jan 21, 2025
3 checks passed
@cristianoventura cristianoventura deleted the fix/sentry-sourcemaps branch January 21, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants