chrisjmccreadie
12/09/2021, 11:55 AMSubh
12/09/2021, 11:55 AMSubh
12/09/2021, 11:55 AMSubh
12/09/2021, 11:55 AMSubh
12/09/2021, 11:55 AMchrisjmccreadie
12/09/2021, 11:55 AMchrisjmccreadie
12/09/2021, 11:55 AMchrisjmccreadie
12/09/2021, 11:55 AMSubh
12/09/2021, 11:58 AMgeelen
12/09/2021, 11:58 AMawait request.text()
i think?geelen
12/09/2021, 11:58 AMchrisjmccreadie
12/09/2021, 12:00 PMSubh
12/09/2021, 12:00 PMSubh
12/09/2021, 12:00 PMchrisjmccreadie
12/09/2021, 12:00 PMKeenwau
12/09/2021, 12:18 PMKeenwau
12/09/2021, 12:23 PMnext dev
I can't call functions after running wrangler pages dev
proxied to the same port. Same result with wrangler pages dev -- next dev
.
Seems like Next assumes anything unmatched under root is a 404, preventing wrangler's dev server from accepting functions.
I'm just using a different port, which isn't the end of the world, but was wondering if anyone deploying Next to Pages has encountered this & there's a way to tell Next to ignore my function paths.Subh
12/09/2021, 12:28 PMexport async function onRequestPost({request}) {
?chrisjmccreadie
12/09/2021, 1:01 PMmarkdessain
12/09/2021, 1:55 PMrkusa
12/09/2021, 5:08 PMfragje
12/09/2021, 5:24 PMHardAtWork
12/09/2021, 5:36 PMJustinNoel
12/09/2021, 8:46 PMexport const onRequestGet: PagesFunction = async ({ env, params }) => {
// Can't find a way to type the params because PagesFunction says it should be a string.
const id = params?.id;
const aws = new AwsClient({
// `env` is "unknown" and I can't modify it with any typing on line 1
accessKeyId: env.B2_ACCESS_KEY_ID,
secretAccessKey: env.B2_SECRET_ACCESS_KEY,
region: "...",
})
}
Greg Brimble | Cloudflare Pages
12/09/2021, 9:07 PMPagesFunction
takes a three generics: the env, params, and data.JustinNoel
12/09/2021, 9:21 PMKeenwau
12/09/2021, 9:30 PM{env, params}
a type or am I missing something else?Cоlе
12/09/2021, 9:34 PMCоlе
12/09/2021, 9:35 PM--help
I don't even see the --env
option for page dev
Greg Brimble | Cloudflare Pages
12/09/2021, 9:44 PM—binding