Submission created is not being triggered

I have two sites running with the same github repository and env variables. One of them has a custom domain, which I configured last Friday. Now here’s the issue:

I have a Netlify form on both sites, that trigger a submission-created.js function. It works fine on the site without a custom domain. The function isn’t being triggered on the site that has a custom domain (which is password protected using Netlify’s in built password auth). It fails to trigger from both the and the urls. The form submissions do come through (on both sites)

The site id without triggering submission-created: f1517f9c-3e53-4d3b-b4ea-3a912babc2c8
The site id with triggering submission-created: a52e3e8e-8724-415a-81fc-215ef3c17723

It’s meant to go live tomorrow so I’d appreciate a quick response :slight_smile:

The password protection seems to be the problem. After I’ve deleted the access control settings, the function triggers again on form submission. I’m glad I worked that out, but I don’t think this is what you’d typically call ‘expected behavior’. Consider this a bug report, I’d be happy to share more information if requested.

Yup, I came here to suggest that our system just accesses the function without any authentication, so this wouldn’t be expected (by us) to work if you have site-wide protection on. You could of course consider using basic auth to protect only the parts of the site that you want and not the functions; this should allow the functionality to work as you’re expecting:

I will propose an update to our documentation here to reflect that: Trigger functions on events | Netlify Docs - does that seem to you, like it’s the right place to put this caveat (similar to: Large Media requirements and limitations | Netlify Docs)?

Absolutely. Or even better: a notification (or at least explanation) in the settings where you set the password, just like the one that you’d get on a deploy deletion, basically.

Great suggestion! I’ll put in a feature request over there too :slight_smile:

1 Like

Hey there, @tomrutgers :wave:

I just wanted to follow up and thank you for sharing your feedback in this thread. Our Docs team have updated the docs to include limitations in our trigger functions section.

Feedback is what makes our product better, and we appreciate you taking the time to surface what your obstacle was here!

Happy building :rocket:

1 Like