mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-12 11:28:58 -05:00
207ad3c7bd
Fixes FORMBRICKS-TK Custom scripts injected via CustomScriptsInjector can attempt to access undefined global variables (like zp_token) before they're defined, causing a ReferenceError that breaks the survey page. This fix wraps inline script content in an IIFE with try-catch to gracefully handle errors from undefined variables. Also adds error handlers for external scripts that fail to load. The survey page will now continue to function even when custom scripts encounter runtime errors, with warnings logged to the console for debugging.