Hello,
I’m currently building a static Next.js site on pages that needs just a couple of supporting backend bits. I’d prefer not to make the whole site dynamic as at this point it would require me to completely overhaul the data access (which is reading frontmatter+markdown from static files on the filesystem at build time).
One of the functions is using the Square Payments API which requires some node.js APIs. When I try to create it as a function, the build errors out with:
The package “crypto” wasn’t found on the file system but is built into node.
Add “node_compat = true” to your wrangler.toml file to enable Node compatibility.
However, it doesn’t seem like Functions respects a wrangler.toml that exists in the repo.
Is there a way to accomplish what I’m trying to accomplish within the Cloudflare Pages product, or do I need to bite the bullet and do a complete separate setup on Workers to handle this one function?
Thanks!