Content-Length: 322740 | pFad | http://github.com/getsentry/sentry-javascript/pull/15710

4D fix(nuxt): Add Nitro Rollup plugin to inject Sentry server config by s1gr1d · Pull Request #15710 · getsentry/sentry-javascript · GitHub
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(nuxt): Add Nitro Rollup plugin to inject Sentry server config #15710

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Mar 17, 2025

Previously, the Sentry server config was added by adding another entry point in the rollup options of Vite. Since Nuxt changed preserveModules to true, this did not work anymore. The aim of this change in Nuxt is to avoid duplicating what the Nitro build would do.

This means, that we now don't change the Rollup options in Vite anymore (affects Nuxt as a whole) but only the Rollup options during the Nitro build.

The added plugin will emit a new file and returns the Sentry config code there.

fixes #15628

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice, this looks very clean!

@s1gr1d s1gr1d merged commit 26e2d17 into develop Mar 18, 2025
36 checks passed
@s1gr1d s1gr1d deleted the sig/inject-server-config-fix branch March 18, 2025 09:18
@luc122c
Copy link

luc122c commented Mar 18, 2025

@s1gr1d Thanks for fixing! :) Is this part of the dynamic import method? To benefit from this, will we need to migrate from the --import method?

@s1gr1d
Copy link
Member Author

s1gr1d commented Mar 18, 2025

No, it's not related :)

The rollup plugin I added for this fix, only adds the server config to the build output (which was happening before already).

The rollup plugin for the dynamic import is a different one and this was not changed: https://github.com/getsentry/sentry-javascript/blob/develop/packages/nuxt/src/vite/addServerConfig.ts#L204

s1gr1d added a commit that referenced this pull request Mar 18, 2025
Adding tests for the [nightly
channel](https://nuxt.com/docs/guide/going-further/nightly-release-channel)
of Nuxt.

Right now, they are failing - will merge this PR once they are not
failing anymore. See issue:
#15628

This PR adds fixes to the tests should not fail anymore:
#15710
@github-actions github-actions bot mentioned this pull request Mar 19, 2025
3 tasks
@danielroe
Copy link

thank you @s1gr1d ❤️

s1gr1d added a commit that referenced this pull request Mar 20, 2025
Follow-up for #15710

The server config was still processed by Nuxt (not only Nitro) because
the file was imported in a plugin template. This code can be deleted
now, as the Sentry server config should only be processed on the
Nitro-side.


fixes #15628
s1gr1d added a commit that referenced this pull request Mar 24, 2025
Due to PR #15710 the
Sentry server config is only processed inside the Nitro-part of Nuxt and
the server config file is emitted through the Rollup plugin.

It is not needed anymore to copy-paste the file manually (this has been
the case before as the file was added to the `.nuxt` folder - as it was
processed by Nuxt, not Nitro-only).

This fixes the "no such file" error [posted in this
comment](#13330 (comment)).

closes #13330
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.

Build broken with Nuxt 3.16.0
4 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/getsentry/sentry-javascript/pull/15710

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy