"No STACKBIT_CONTACT_FORM_SECRET provided" on new Netlify Create project

Hello everyone,

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.
chrome_wM7gfZSSqv

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!

Sounds something to do with the template and not us. Did you try contacting the template authors?

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:

1 Like

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

Hi @Trustful2126 :wave: ,

I transferred the Create site to your Netlify team dashboard. Please let me know if you’re still having trouble finding it.

1 Like

Hi @audrey,

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.

  • Full Build log:
12:11:08 PM: Netlify Build                                                 
12:11:08 PM: ────────────────────────────────────────────────────────────────
12:11:08 PM: ​
12:11:08 PM: ❯ Version
12:11:08 PM:   @netlify/build 29.39.2
12:11:08 PM: ​
12:11:08 PM: ❯ Flags
12:11:08 PM:   baseRelDir: true
12:11:08 PM:   buildId: 6623a2631dda68b83fc2c4a9
12:11:08 PM:   deployId: 6623a2a78ab95a000850c047
12:11:08 PM: ​
12:11:08 PM: ❯ Current directory
12:11:08 PM:   /opt/build/repo
12:11:08 PM: ​
12:11:08 PM: ❯ Config file
12:11:08 PM:   /opt/build/repo/netlify.toml
12:11:08 PM: ​
12:11:08 PM: ❯ Context
12:11:08 PM:   production
12:11:08 PM: ​
12:11:08 PM: ❯ Using Next.js Runtime - v5.1.2
12:11:10 PM: ​
12:11:10 PM: @netlify/plugin-nextjs (onPreBuild event)                     
12:11:10 PM: ────────────────────────────────────────────────────────────────
12:11:10 PM: ​
12:11:10 PM: Next.js cache restored
12:11:10 PM: ​
12:11:10 PM: (@netlify/plugin-nextjs onPreBuild completed in 93ms)
12:11:10 PM: ​
12:11:10 PM: build.command from netlify.toml                               
12:11:10 PM: ────────────────────────────────────────────────────────────────
12:11:10 PM: ​
12:11:10 PM: $ npm run build
12:11:10 PM: > content-ops-theme@0.1.0 build
12:11:10 PM: > next build
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:11 PM:    Linting and checking validity of types ...
12:11:13 PM:    Creating an optimized production build ...
12:11:16 PM:  βœ“ Compiled successfully
12:11:16 PM:    Collecting page data ...
12:11:18 PM:    Generating static pages (0/6) ...
12:11:19 PM:    Generating static pages (1/6)
12:11:19 PM:    Generating static pages (2/6)
12:11:19 PM: No STACKBIT_CONTACT_FORM_SECRET provided. It will not work properly for production build.
12:11:19 PM:    Generating static pages (4/6)
12:11:19 PM:  βœ“ Generating static pages (6/6)
12:11:22 PM:    Finalizing page optimization ...
12:11:22 PM:    Collecting build traces ...
12:11:38 PM: Route (pages)                              Size     First Load JS
12:11:38 PM: β”Œ   /_app                                  0 B             135 kB
12:11:38 PM: β”œ ● /[[...slug]] (3619 ms)                 3.56 kB         138 kB
12:11:38 PM: β”œ   β”” css/999d88c793fe2fe8.css             257 B
12:11:38 PM: β”œ   β”œ /blog (981 ms)
12:11:38 PM: β”œ   β”œ / (899 ms)
12:11:38 PM: β”œ   β”œ /web (871 ms)
12:11:38 PM: β”œ   β”” /contact (868 ms)
12:11:38 PM: β”œ β—‹ /404                                   180 B           135 kB
12:11:38 PM: β”” Ξ» /api/reindex                           0 B             135 kB
12:11:38 PM: + First Load JS shared by all              147 kB
12:11:38 PM:   β”œ chunks/framework-0c7baedefba6b077.js   45.4 kB
12:11:38 PM:   β”œ chunks/main-d6ca93fb6cd6ec69.js        32.9 kB
12:11:38 PM:   β”œ chunks/pages/_app-8509728e65cace4b.js  54 kB
12:11:38 PM:   β”œ chunks/webpack-18f726f1d6e1f8c4.js     2.63 kB
12:11:38 PM:   β”” css/13fa65414cc78f4b.css               11.8 kB
12:11:38 PM: Ξ»  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
12:11:38 PM: β—‹  (Static)  automatically rendered as static HTML (uses no initial props)
12:11:38 PM: ●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
12:11:38 PM: ​
12:11:38 PM: (build.command completed in 28.7s)
12:11:38 PM: ​
12:11:38 PM: @netlify/plugin-nextjs (onBuild event)                        
12:11:38 PM: ────────────────────────────────────────────────────────────────
12:11:38 PM: ​
12:11:39 PM: Next.js cache saved
12:11:40 PM: ​
12:11:40 PM: (@netlify/plugin-nextjs onBuild completed in 1.2s)
12:11:40 PM: ​
12:11:40 PM: Functions bundling                                            
12:11:40 PM: ────────────────────────────────────────────────────────────────
12:11:40 PM: ​
12:11:40 PM: Packaging Functions from .netlify/functions-internal directory:
12:11:40 PM:  - ___netlify-server-handler/___netlify-server-handler.mjs
12:11:40 PM: ​
12:11:40 PM: Packaging Functions from .netlify/functions directory:
12:11:40 PM:  - submission_created.js
12:11:40 PM: ​
12:11:43 PM: ​
12:11:43 PM: (Functions bundling completed in 2.9s)
12:11:43 PM: ​
12:11:43 PM: Edge Functions bundling                                       
12:11:43 PM: ────────────────────────────────────────────────────────────────
12:11:43 PM: ​
12:11:43 PM: ​
12:11:43 PM: (Edge Functions bundling completed in 351ms)
12:11:43 PM: ​
12:11:43 PM: @netlify/plugin-nextjs (onPostBuild event)                    
12:11:43 PM: ────────────────────────────────────────────────────────────────
12:11:43 PM: ​
12:11:43 PM: ​
12:11:43 PM: (@netlify/plugin-nextjs onPostBuild completed in 10ms)
12:11:43 PM: ​
12:11:43 PM: Uploading blobs to deploy store                               
12:11:43 PM: ────────────────────────────────────────────────────────────────
12:11:43 PM: ​
12:11:43 PM: Uploading 6 blobs to deploy store...
12:11:43 PM: Done uploading blobs to deploy store.
12:11:43 PM: ​
12:11:43 PM: (Uploading blobs completed in 211ms)
12:11:43 PM: ​
12:11:55 PM: (Netlify Build completed in 47.3s)
12:11:56 PM: Section completed: building
12:12:00 PM: Finished processing build request in 1m13.422s

Hi there,

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

Best
Youval

2 Likes