-
Notifications
You must be signed in to change notification settings - Fork 113
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
Nuxt 3 compatibility #358
Comments
Thanks for reporting. This is discussed in https://github.com/nuxt/framework/discussions/751#discussioncomment-1468163 a bit. I would still like some answers from the team and better documentation since it's not clear how things should look going forward. And related to that, I'm not in a rush to fix it since Nuxt 3 appears to need quite a bit of work before it stabilizes. Open to any suggestions and help though. |
Missed that! Still this issue could be useful so others can find this too and for tracking support down the line. |
I have written the following Nuxt 3 plugin which seems to be working fairly well for me. Note that Sentry's SDK doesn't seem to play well with the native Vue error event handler when For anyone else using Nuxt 3 that this may be useful for..
|
With Nuxt 3 RC1 being released in the coming days, has there been any movement on this? |
Not really. If anyone knows how everything can be made to work in Nuxt 3 then feel free to contribute. The biggest problem might be with getting it to work on the server-side (in server middleware specifically) as Nuxt 3 doesn't want modules to run at runtime and I haven't seen an equivalent to current solution for Nuxt 3. |
@rchl http://v3.nuxtjs.org/api/advanced/kit As far as I can understand, you can call addPlugin, addServerMiddleware, and Webpack/Vite methods in module, and those settings will be applied when project start. Is this something that will allow module to run on runtime and allow migration to Nuxt 3? |
One thing that would need to be figured out is publishing of releases which relies on a webpack plugin provided by Sentry right now. It won't work with Vite. As for using |
Damn. That would be hard then. |
I found https://github.com/ikenfin/vite-plugin-sentry, but its unofficial. I'm not using that plugin myself so I don't know if it would fit here. |
About that, I am looking into making a unplugin for sentry which would support, webpack, vite, rollup and esbuild. unplugin-sentry and also have made a Dev repo where I might work on the sentry module. nuxt-sentry |
@asonnleitner appreciate the work and hope that we could use and/or merge those changes at some point. Though it's still not fully clear to me how the situation looks like right now when it comes to module supporting both Nuxt 2 and Nuxt 3. While
|
How is this going? Trying to migrate to nuxt-edge and this plugin doesns't seem to work. Should we ask for help or something, because I'm not sure how you can migrate any meaningful app without error reporting. Especially at a time where you are expecting the error rate to skyrocket due to breaking changes of packages |
@danielroe can we get some insights here on the problems that are troubling the maintainers of this library? We really need to get this module working, Sentry is the premier package for error reporting and is probably used across most of Vue/Nuxt projects. I'm not sure any people working on production-ready apps would be willing to migrate if they don't have error reporting abilities. |
@rchl I think to make the plugin compatible with all nuxt2/bridge and 3 should not be an issue, but I am currently a bit tight with time so will take a while until I'll have a look at it in-depth. |
I do not really care about the message, so it will be fine, but I am getting the following error when I use this code: Again, it does not really make sense, but also I am not depended on it, so it will be fine for me. Just curious.. |
Just installing the |
For server side, I kinda manage to run Sentry node at bare minimum (still not working great tho, I think) // plugins/sentry.server.ts
import * as Sentry from '@sentry/node';
import '@sentry/tracing'; // Side-effect the tracing init
export default defineNuxtPlugin(app => {
Sentry.init({ ... });
return {
provide: {
sentry: Sentry,
}
};
}); Combined with the
|
@akasection Stupid question: how did you realize you had to include |
When I tried import It's still wasteful approach tho, because instead of importing the correct ESM one, it re-transpiles the CJS dist into ESM. |
For me, it is working in the client but not in the server. I created a plugin in import { defineNuxtPlugin } from '#app';
// eslint-disable-next-line no-restricted-imports
import * as Sentry from '@sentry/node';
import { NODE_ENV, SENTRY_DSN } from '@/constants';
export default defineNuxtPlugin(() => {
Sentry.init({
logErrors: true,
dsn: SENTRY_DSN,
environment: NODE_ENV,
normalizeDepth: 5,
});
}); Does anyone know what I'm doing wrong? |
@andresespinosapc I have to manually pull it in from import * as Sentry from '@sentry/serverless';
export default defineNuxtPlugin(() => {
return {
provide: { sentryServer: Sentry },
};
}); And then in the code: const { $sentryServer } = useNuxtApp(); |
@andresespinosapc try transpile the |
@rchl hello there. getsentry/sentry-webpack-plugin#375 (comment) Once this new plugin is finished, will you be able to add support for Vite in this plugin? Also, do you have any status for your Nuxt 3 migration plans? It will be out of RC pretty soon now. |
Same answer as in #433 (comment) but I'm sure someone could contribute to this project and it wouldn't have to be me.
I suppose this goes hand in hand with supporting Vite. As far as going out of RC soon, what is your source? Nuxt 3 was supposed to be released early this year or something and yet new RC versions are coming out with breaking changes and new features (quite unusual for "RC"). Also, it's still unclear whether we can make a version that will be compatible with Nuxt Bridge and Nuxt 3 at the same time or are there still blocking issues that would required two separate versions of the module. |
They said in last RC 12 that they plan to make 1-2 more RCs. That can change though, but I think this Autumn it will finally release.
Can't argue with that.
Nuxt team says it is possible. Do you plan to wait until Bridge becomes stable as well and then decide? |
Yes, I personally would wait for things to stabilise and for final Nuxt 3 to be released. I don't have time to deal with breaking changes and keep updating things for each RC. If someone else wants to deal with that then there is an option of contributing. Also, last time I've tried to attempt the migration the functionality needed for this module didn't exist in bridge/Nuxt 3. |
Fair enough.
I guess if supporting both versions will stay impossible one day Nuxt 3-only version will become a needed thing. Long after stable release for the guys to have time to update. |
https://twitter.com/nuxt_js/status/1590312836412379137 Nuxt has been mentioned as nearly-stable, and will be released as stable in the coming weeks. +1 For nuxt 3 Support on Sentry |
FYI Nuxt 3 stable is out now |
https://github.com/getsentry/sentry-javascript-bundler-plugins have reached 0.1.0 version May I suggest this solution to @rchl problem:
This:
Possible version branches I see:
I'm not sure if 7.0 really needed, as I can't quite understand if upgrading this module to Bridge will inproduce breaking changes. As I could see from other libs, their Bridge version could even be minor one with no breaking changes. Possible variants I see now:
I hope I did help in any way with most of your concerns about this lib. |
There is progress being made in #456 |
Now I feel weird about this big message lol But that's nice to see some progress after all! |
Any updates here? |
Hello all together 🙂 |
u can write u own composable ;) |
I've created #530 with a bit more concrete info. |
care to share with the class on how to do that? |
i have created a layer, and published at npm |
With nuxt 3 out in beta, it would be nice if this module can be updated so it also supports v3.
It should be possible to support both by using
@nuxt/kit
.The version 3 has said it's compatible with v2 modules but I'm seem to be experiencing issues. Is it might be because this module not using the lastest dependencies?
If this in fact meant to be working with v3, are there any way to ensure that fact with tests?
The text was updated successfully, but these errors were encountered: