SaaS CMS has officially launched! Learn more now.

BUG: EPiServer.Forms 5.8.2. Jquery error prevents forms from being submitted


I've just upgraded from EpiServer.Forms 5.8.0 to EpiServer.Forms 5.8.2 and now I get this error message when trying to submit a form.

jquery-3.5.1.min.js:2 jQuery.Deferred exception: Cannot read properties of undefined (reading 'RequestVerification') TypeError: Cannot read properties of undefined (reading 'RequestVerification')
    at Object.getAntiForgeryToken (
    at Object.buildSubmitRequestHeader (
    at _doSubmitForm (
    at e (
    at t ( undefined

These are the form packages that my project is using and I've upgraded each one by one to test which one is the culprit and after upgrading Episerver.Forms to 5.8.2 this error occurs (after upgrading both .Core and .Ui to 5.8.2). On 5.8.0 it works as expected.

<PackageReference Include="EPiServer.Forms" Version="5.8.2" />
<PackageReference Include="EPiServer.Forms.Core" Version="5.8.2" />
<PackageReference Include="EPiServer.Forms.Samples" Version="4.2.2" />
<PackageReference Include="EPiServer.Forms.UI" Version="5.8.2" />
May 24, 2024 6:53

Have you by any chance overriden FormContainerInitScript.cshtml file by placing it in your project ? The package adds some antiforgery stuff in the file (epi.EPiServer.SystemSettings at the bottom) you might be missing after the upgrade. Adding that section manually should fix the issue

May 27, 2024 12:43
Arjan Paauw - Jul 03, 2024 5:24
Just what I ran into, thanks!

Oooh, yeah I have and since it was a minor update I didn't think about checking for new updated views.

May 29, 2024 11:00
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.