I’m building a chat widget where users can customize the bubble color. The color is stored in Supabase and needs to be applied dynamically. This works perfectly on Chrome but fails completely on Safari.
The original problem:
In a WeWeb binding/formula, I access the color like this:
context.component?.props?.['24cfb775-fba6-47f4-82fc-0a74f7c3da74']?.styles?.backgroundColor
-
Chrome returns:
#18181B(correct value) -
Safari returns:
none
What I’ve tried:
1. Breaking down the optional chaining:
const props = context.component?.props;
const componentProps = props ? props['24cfb775-fba6-47f4-82fc-0a74f7c3da74'] : null;
const styles = componentProps?.styles;
const backgroundColor = styles?.backgroundColor;
return backgroundColor;
Result: still doesn’t work on Safari.
2. Using CSS custom properties as a workaround:
Set a default in CSS:
:root {
--chat-bubble-color: pink;
}
Then override it via JavaScript workflow:
const color = formulas['3af6a859-f267-46b7-a8ef-aa557f4b86bc']()?.styles?.backgroundColor;
if (color) {
document.documentElement.style.setProperty('--chat-bubble-color', color);
}
-
Chrome: works, CSS variable gets updated to the database value
-
Safari:
formula()returnsundefined, CSS variable stays on default
3. Debugging the formula step by step:
const formula = formulas['3af6a859-f267-46b7-a8ef-aa557f4b86bc'];
const result = formula();
console.log('result:', result);
-
Chrome: logs the correct object with styles
-
Safari: logs
undefined
4. Triggering on button click instead of page load: Same result — undefined on Safari even when manually triggered after page is fully loaded.
5. Removing all optional chaining syntax: Still undefined on Safari.
The core issue is that accessing dynamic data from Supabase via WeWeb’s context/formulas works on Chrome but returns undefined or none on Safari. This makes it impossible to apply any user-customized styling on Safari.
Is there a Safari-compatible way to access collection/variable values? Or is this a known bug with WeWeb’s formula system on Safari?
I also tried several AI-based workarounds, approaching the problem from different angles, but nothing produced a consistent or professional result. I’m hoping someone can shed some light on this ![]()
![]()
![]()