Hi how would I go about using wrangler

Hi, how would I go about using wrangler for dev environment with next.js in edge mode as described in https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/ ? I'm making a next.js app to be deployed on pages, not as static export but using the edge runtime. But there is nothing about how to run that locally with wrangler.
3 Replies
Barry
BarryOP2y ago
I figured combining npx @cloudflare/next-on-pages --experimental-minify and npx wrangler@latest dev .vercel/output/static/_worker.js should provide a solution, but this is giving errors even on a brand new project
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'fetch')

return env.ASSETS.fetch(request);
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'fetch')

return env.ASSETS.fetch(request);
Barry
BarryOP2y ago
And if I add --experimental-local then it gives this
No description
Barry
BarryOP2y ago
Okay, I realised it's missing compatibility flags, I added those and it's still giving errors. I can make a reproduction repo later but it's easy to reproduce just following the guide in the link I posted, and then trying to run it with wrangler. where would be the best place to get help on this? @here
Want results from more Discord servers?
Add your server