Open CloudBop opened 1 year ago
As danyim mentioned this issue seems to be related to https://github.com/gatsbyjs/gatsby/issues/38467
Rolling back to 7.9.0 (at least for me) 'fixes' both of these issues.
I get this issue when using getServerData() to create SSR pages. Desperate for a solution here.
I am getting same issue in one of my project
I am using 7.9.0
Preliminary Checks
Description
Howdy,
I'll try and be brief. I'm getting this troublesome error. Frustratingly, It's one of those errors that happens right at the end of the build process. My laptop hates me and is trying to fly away. I've resorted to using an External HDD to throttle the build process in order to tame the fans.
Here it is...
It seems to be being caused by the export const config implementation which I am using as to attempt this tutorial -> Stripe webhook verification in a Gatsby Serverless Function - https://www.youtube.com/watch?v=Wqilgl_V7FA
I think I'm following the correct implementation and syntax from the documentation below, but no success as of yet.
https://www.gatsbyjs.com/docs/reference/functions/middleware-and-helpers/
I'm in the process of trying to recreate the error but as the site is abstracted out across a few themes (and their own plugins) it's not so easy to recreate. I will keep on persevering to recreate the error but this error is tricky to track/recreate as I have to wait for the build process to get to the failing stage.
If anyone has ideas to what's happening or has any advice with troubleshooting it would be very much appreciated. Perhaps there's a conflict in the order of the plugins or their dependencies / peerDeps. Could it be the order or the workspace dependency array in the root package.json ?
It's really strange how the error only comes about when including code below...
...in an cloud API function. It doesn't matter whether the function is created in a gatsby-theme/src/api/gatsby-theme or the consuming site API. I get the same error.
I'm really confused as I suppose that the build error itself is probably being caused by something other than the Gatsby-function implementation. But Without the export config the site builds ok and everything works fine in dev mode.
Thanks
Reproduction Link
https://github.com/CloudBop/gatsby-func-cloud-raw
Steps to Reproduce
I am in the process of trying to recreate this error.
Expected Result
Using the named export config {} and bodyParser with a cloud function should allow for rawHeaders to be received in buffer form and should also build successfully.
Actual Result
When running
"build": "gatsby build --verbose",
get the errorEnvironment
Config Flags
No response