robmarshall / gatsby-gravityforms-component

A component to take gatsby-source-gravityforms query data and return usable components
GNU General Public License v3.0
27 stars 23 forks source link

confirmation_message null error #35

Closed AskChanDra closed 3 years ago

AskChanDra commented 3 years ago

With the latest version 3.1.0 gatsby-source-gravityforms getting this error and to fix this I added a patch to change "confirmation_message" to "message".

AskChanDra commented 3 years ago

Sorry My mistake

Chinomso1995 commented 3 years ago

I am getting this error too. How did you go about fixing it.

AskChanDra commented 3 years ago

It was due to the use of the wrong Lambda function URL.

Make sure you are using correct format e.g. FUNCTIONS_URL=/.netlify/functions/newGfEntry in .env.development. or simply use /.netlify/functions/newGfEntry instead of .netlify/functions/newGfEntry Or last option use absolute URL: http://localhost:8000/.netlify/functions/newGfEntry

Let me know if doesn't fix.

Thanks Chandra

Chinomso1995 commented 3 years ago

I used that but it didn't work. I commented out the code and I get a 200 status and a success message with my information and everything viewable. I just hope that bit doesn't really have any important information.

Chinomso1995 commented 3 years ago

What's the major url you uses in sending this to the WordPress backend.

AskChanDra commented 3 years ago

main app.js Note : make sure you log formData and your are fully connected with WordPress with WPGraphQL plugin

<GravityFormForm
          id={4}
          formData={formData}
          lambda={process.env.FUNCTIONS_URL}
          successCallback={handleSuccess}
          errorCallback={handleError}
        />

and env with values below

FUNCTIONS_URL=/.netlify/functions/newGfEntry

Make sure you'r running your app using Netlify as below

netlify dev
Chinomso1995 commented 3 years ago

I was able to get it working by plugging it directly into WordPress but I don't want to use that in production. What I did was putting my gf-entry.js code into a functions folder and then declaring Functions = lambda in the build command in the toml file. Installing netlify lambda and then specifying the specific Function port in the URL. I see my functions being built Into the lambda folder but when I try to send a request I get an error of cannot initialise t before declaration and a 500 status error. How did you go about getting your functions to work specifically.

AskChanDra commented 3 years ago

Make sure you have created the functions folder on the Netlify.com website on your settings page. That will map to your local working copy then it needs to connect with the online system just for some configuration and then you can test the Lamda function locally.