-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
There was a problem hiding this 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 Thanks for fixing! :) Is this part of the dynamic import method? To benefit from this, will we need to migrate from the --import method? |
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 |
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
thank you @s1gr1d ❤️ |
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
Previously, the Sentry server config was added by adding another entry point in the rollup options of Vite. Since Nuxt changed
preserveModules
totrue
, 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