-
-
Couldn't load subscription status.
- Fork 1.7k
Should the sentry/nuxt version have an impact on the nuxt build command's output? #14064
-
I'd like to know if I'm even barking up the right tree. This stuff goes a bit above my head, but I think I found the cause (though I don't understand it).
After upgrading from @sentry/nuxt 8.34.0 to @sentry/nuxt 8.35.0 I had an issue where my generated .output/server no longer contained a server function which is used to serve SSR content. Downgrading back to 8.34.0 reinstates that function.
As an example, when running nuxt build --preset=firebase this is what .output/server/index.mjs looked like before and after upgrading to 8.35.0.
.output/server/index.mjs (8.34.0)
import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};;!function(){try{var e="undefined"!="undefined"?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="46baedab-cac0-4734-adf3-d022721db3a9",e._sentryDebugIdIdentifier="sentry-dbid-46baedab-cac0-4734-adf3-d022721db3a9")}catch(e){}}();import 'firebase-functions/v2/https'; export { B as server } from './chunks/runtime.mjs'; import 'node:http'; import 'node:https'; import 'node:fs'; import 'node:path'; import '@sentry/node'; import '@sentry/core'; import '@sentry/utils'; import '@primevue/core/base/style'; import 'firebase-admin/auth'; import 'vuefire/server'; import 'consola/core'; //# sourceMappingURL=index.mjs.map
.output/server/index.mjs (8.35.0)
import process from "node:process"; globalThis._importMeta_ = { url: import.meta.url, env: process.env }; !(function () { try { var e = "undefined" != "undefined" ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, n = new e.Error().stack; n && ((e._sentryDebugIds = e._sentryDebugIds || {}), (e._sentryDebugIds[n] = "43aa2bdc-7ac0-4400-93e4-8447ceda11fe"), (e._sentryDebugIdIdentifier = "sentry-dbid-43aa2bdc-7ac0-4400-93e4-8447ceda11fe")); } catch (e) {} })(); import * as Sentry from "@sentry/nuxt"; import "import-in-the-middle/hook.mjs"; // proceeds to include my entire package.json as javascript ** import("./chunks/runtime.mjs").then(function (n) { return n.B; }); async function reExport(...args) { const res = await import("./chunks/runtime.mjs").then(function (n) { return n.B; }); return res.server.call(this, ...args); } export { reExport as server };
Beta Was this translation helpful? Give feedback.
All reactions
Hy, there were a couple of issues with the newly added rollup plugin which adds the dynamic import. Currently, we are not going forward with this option.
Please install version 8.45.0 (or higher) and follow the Installation Methods in the docs. You probably have to use top-level import on firebase.
Replies: 4 comments 2 replies
-
@s1gr1d seems like we also need to proxy server exports.
Beta Was this translation helpful? Give feedback.
All reactions
-
In 8.34.0, a rollup plugin was introduced to initialize Sentry before the rest of the app is loaded. This changes the code in index.mjs and re-exports previous exports. With this change you don't have to add the --import flag anymore.
However, the function for firebase is currently not exported. #14086 will fix this.
Thanks for reporting!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Hi @s1gr1d I can confirm that 8.36.0 fixed the above issue.
Today, however, after upgrading to 8.43.0 I noticed a regression for this. From my testing it seems like the issue was re-introduced in 8.38.0 (8.37.1 is the latest version that still seems to build index.mjs correctly).
Beta Was this translation helpful? Give feedback.
All reactions
-
Actually, it seems like the fix for 8.36.0 also does not work. The file, index.mjs, look similar to what it did in 8.34.0 (with the exception of import 'import-in-the-middle/hook.mjs'; being added) but somehow when watching .output/server for Cloud Functions it does not detect anything.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hy, there were a couple of issues with the newly added rollup plugin which adds the dynamic import. Currently, we are not going forward with this option.
Please install version 8.45.0 (or higher) and follow the Installation Methods in the docs. You probably have to use top-level import on firebase.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks for the feedback @s1gr1d; I'll look into these options in the new year.
Beta Was this translation helpful? Give feedback.