I have recently created a new website using the Premium Website Starter template on Netlify Create(Stackbit). Project ID: 6606d0479cc8b700bd34ae73
THE ISSUE:
When trying to submit a form on the new website, I get this error: [debug] [nextjs]: No STACKBIT_CONTACT_FORM_SECRET provided. It will not work properly for production build.
I have no idea how to solve it, I have tried asking the AI chatbot but the suggestion it provided was similar to this forum post from FEB 14. However, it didnβt work for me as I canβt find my Netlify Create project on app.netlify.com/teams
Any assistance or guidance would be greatly appreciated. Thank you!
Thank you for your response, I used one of the two full starter templates found on the Netlify Create website (there are no Github or contact links for the Premium Website Starter template) :
However, even after trying the second template (Personal Site), I encountered the same issue: [debug] [nextjs]: No STACKBIT_CONTACT_FORM_SECRET provided. It will not work properly for production build.
Itβs strange because I had already created a website with the same template before the Netlify/Stackbit merge, and the form submission worked out of the box.
Yeah looks like that template is automatically put into a repo and added as a private repo here: stackbit-projects (Stackbit) Β· GitHub. From the project settings, could you see if you can get the project transferred to yourself:
could you see if you can get the project transferred to yourself
Yes thatβs what i did a couple days ago in hope that it would solve my problem. After i confirmed the email invite, the repo was successfully transferred to my personal Github account but the form submission problem remains the same.
According to @audreyβs reply on this forum post (FEB 14), Iβm supposed to copy the STACKBIT_CONTACT_FORM_SECRET environment variable from my Netlify team dashboard > Sites app.netlify.com/teams/{MyTeam}/Sites/ over to Netlify Create/Stackbit > Project settings > Advanced tab create.netlify.com/studio/{projectID}/settings/advanced. However i cannot find the project on my Netlify team dashboard, the project is only showing on my Netlify Create/Stackbit dashboard.
I have also tried creating new projects through Netlify Create/Stackbit using other templates, but had the same issue of the projects not being shown on Netlify team dashboard > Sites
Thank you for your help!, I can now access my Netlify Create website through my Netlify team dashboard.
As for the form submission issue, I immediately went searching for the STACKBIT_CONTACT_FORM_SECRET env variable in Site configuration > Environment Variables, but couldnβt find any variables in there, unfortunately.
I can only assume that the feature is no longer supported, or maybe itβs still a work in progress due to the Netlify/Stackbit merge.
It was a really nice feature though, and it worked out of the box, I just had to create a project using one of the provided FULL STARTER templates found on Netlify Create/Stackbitβs website and set a destination email address for the form using the visual editor, and then I would automatically receive the form submissions in my inbox.
For now, Iβm using a Google form instead, and Iβm honestly okay with it, I donβt want to keep bothering you guys because of this small issue. Thank you all for your help and assistance!
Additional Resources:
My websiteβs build log (these lines caught my attention):
12:11:10 PM: β Invalid next.config.js options detected:
12:11:10 PM: β "env.stackbitPreview" is missing, expected string
12:11:10 PM: β See more info here: https://nextjs.org/docs/messages/invalid-next-config
12:11:19 PM: No STACKBIT_CONTACT_FORM_SECRET provided. It will not work properly for production build.
Since the Stackbit acquisition by Netlify, we no longer managing form submissions on behalf of users (as you can see itβs not in the updated documentation)
Look into the .netlify folder of your template to remove unneeded functionality that shows these build errors