SyntaxError: JSON.parse fails in initFileField — data-label-overwrites attribute malformed

A JavaScript error is consistently thrown on pages containing brf-pro-forms-field-file elements with custom label overwrites configured. The error occurs in the internal initFileField function and breaks field initialization.

Error:

Uncaught SyntaxError: Expected ',' or '}' after property value in JSON at position 63
    at JSON.parse (<anonymous>)
    at window.bricksforgeData.initFileField

Steps to reproduce:

  1. Create a Pro Forms field of type File Upload
  2. Set a custom label in the Label Idle field (e.g. with HTML span tags)
  3. Load the page containing the form
  4. Open browser console — error is thrown immediately on page load

Expected behavior: Field initializes correctly without console errors.

Actual behavior: JSON.parse fails at position 63 of the data-label-overwrites attribute, which appears to be generated with malformed JSON by the plugin itself.

Additional context:

  • The error fires twice when two file upload fields exist on the same page
  • Changing fileUploadAllowedTypes format had no effect
  • Removing initialFilesMethod: custom had no effect
  • The issue is reproducible across different file upload fields and configurations

Environment:

  • BricksForge version: [3.1.8.5]
  • Bricks Builder version: [2.3.4]
  • WordPress version: [6.9.4]