Can't deploy middleware function | Qwik • Sentry

Hey ! I'm trying to implement Sentry on the server-side of my Qwik website. I didn't find any working exemples on the internet so i seeked for help on the Qwik and the Sentry Discord servers. I found something on the Qwik Discord that didn't worked, and the guy that answered ma at Sentry's redirected me to the @sentry/cloudflare package that didn't worked too 😦 I am now thinking that I missed something on the Cloudflare part. because the function is not deployed and I think it is not even detected at build time. I have defined my function like this : import * as Sentry from "@sentry/cloudflare"
export const onRequest = Sentry.sentryPagesPlugin({
dsn: "...",
tracesSampleRate: 1.0
})
export const onRequest = Sentry.sentryPagesPlugin({
dsn: "...",
tracesSampleRate: 1.0
})
it is in a /functions/_middleware.js file at the root of the project. I don't know what to do now, can someone help me ?
No description
1 Reply
Ben Akroyd
Ben Akroyd3w ago
I'm also struggling a bit getting started with functions/middleware for a nuxt app. Following this. If I find anything helpful I will share. My questions: - we use wrangler pages deploy dist, as dist is set as the output folder (through a nitro 'cloudflare-pages' preset). I assume that functions/_middleware.js should go in out nuxt project root, not dist/ (to make dist/functions/_middleware.js) correct? - I have yet to see any feedback, anywhere, that our _middleware.js file is working, or erroring. If its working, and console.log statements are in the file, should we see them in instant logs? Should the Functions tab (as pictured above) be updated?

Did you find this page helpful?