I am using a sentry plugin as middleware

I am using a sentry plugin as middleware and a custom function that responds to form submissions. I'll try removing one or the other to see if it's specific to the middleware, for instance, or just having the directory at all.
12 Replies
IanVS
IanVSβ€’17mo ago
Sorry, should have created a thread earlier. I narrowed it down to the sentry plugin.
import sentryPlugin from "@cloudflare/pages-plugin-sentry";

export const onRequest: PagesFunction<{
SENTRY_DSN: string;
SENTRY_ENVIRONMENT: "production" | "deploy-preview";
}> = (context) => {
return sentryPlugin({
dsn: context.env.SENTRY_DSN,
environment: context.env.SENTRY_ENVIRONMENT,
})(context);
};
import sentryPlugin from "@cloudflare/pages-plugin-sentry";

export const onRequest: PagesFunction<{
SENTRY_DSN: string;
SENTRY_ENVIRONMENT: "production" | "deploy-preview";
}> = (context) => {
return sentryPlugin({
dsn: context.env.SENTRY_DSN,
environment: context.env.SENTRY_ENVIRONMENT,
})(context);
};
β–Ά npm ls @cloudflare/pages-plugin-sentry
defined-www@1.0.0 /Users/ianvs/code/defined/www
└── @cloudflare/pages-plugin-sentry@1.1.0
β–Ά npm ls @cloudflare/pages-plugin-sentry
defined-www@1.0.0 /Users/ianvs/code/defined/www
└── @cloudflare/pages-plugin-sentry@1.1.0
I don't have any actual errors being tracked into sentry Seems strange to me that this could be causing the behavior we saw earlier. @csirolli do you also use a function middleware, by chance? When watching the function log stream, refreshing the page will show a successful GET to /site.manifest sometimes, but not always. If the page comes up blank, I don't see a log.
Unknown User
Unknown Userβ€’17mo ago
Message Not Public
Sign In & Join Server To View
IanVS
IanVSβ€’17mo ago
That's what I'm wondering, yeah. @Unsmart | Tech debt is that possible?
Unsmart
Unsmartβ€’17mo ago
I have no clue it is possible the middleware is modifying responses that it shouldnt be 🀷
IanVS
IanVSβ€’17mo ago
OK, I guess I'll create an issue in GitHub and hope that someone sees it. Thanks for your help in troubleshooting. @james090500 out of curiosity, do you also use any middleware? (I opened https://github.com/cloudflare/pages-plugins/issues/23)
james090500
james090500β€’17mo ago
I don't have the same issue I use vhe Vue* was just attempting to debug
IanVS
IanVSβ€’17mo ago
OK, I saw you saying something about having a cached response that was empty Oh no that was someone else, haha thanks, sorry for the ping @proatwork, do you use middleware? You had a similar issue to mine.
Unknown User
Unknown Userβ€’17mo ago
Message Not Public
Sign In & Join Server To View
IanVS
IanVSβ€’17mo ago
Absolutely, thanks so much!
Unknown User
Unknown Userβ€’17mo ago
Message Not Public
Sign In & Join Server To View
IanVS
IanVSβ€’17mo ago
Hi @gregbrimble is there anything else you can share about this? I'm holding off on moving to Cloudflare until middleware works correctly, but if it's going to be a lot longer, I can try working around it and use something other than middleware. Thanks, I updated to the latest version of the sentry plugin, and the issue seems to be resolved.
Unknown User
Unknown Userβ€’17mo ago
Message Not Public
Sign In & Join Server To View