Skip to content

Cloudflare Pages: functions/_middleware.js is not called #9309

Answered by sergiodxa
mthenw asked this question in Q&A
Discussion options

You must be logged in to vote

When using Vite, in development wrangler/workerd is not used as runtime so your CF middlewares will not be called. However when deployed to production because it runs in CF runtime it should work.

The Vite team is working on a way to allows apps/frameworks to change the runtime so instead of Node it can use workerd and run in a production-like env locally.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mthenw
Comment options

Answer selected by mthenw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants