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:
- Create a Pro Forms field of type File Upload
- Set a custom label in the Label Idle field (e.g. with HTML span tags)
- Load the page containing the form
- 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
fileUploadAllowedTypesformat had no effect - Removing
initialFilesMethod: customhad 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]