builder
builder copied to clipboard
"[Builder.io]: Failed code evaluation: Code generation from strings disallowed for this context"
Describe the bug Element data bindings don't work when a Qwik app is deployed to Cloudflare Pages.
To Reproduce Steps to reproduce the behavior:
- Create a Qwik app.
- Add a Cloudflare Pages adapter.
- In Builder, create a section model.
- In code, pass data bindings (state) along with apiKey, model, and content:
<Content apiKey={BUILDER_PUBLIC_API_KEY} model={BUILDER_MODEL} content={content} data={{username: 'SuperUser'}}
- In Builder, in Content, add a New Entry for your section model.
- In Builder, in Editor, add the Basic > Text component.
- In Builder, in Options panel, bind text to dynamic data (state).
- In Builder, publish.
- In code, deploy.
Expected behavior Text bound to dynamic data shows up not just in Editor and local environment, but also when deployed to Cloudflare Pages.
Screenshots Real-time Logs for Functions for deployment in Cloudflare dashboard show errors:
{
"message": [
"[Builder.io]: ",
"Failed code evaluation: Code generation from strings disallowed for this context",
{
"code": "var _virtual_index=state.username;return _virtual_index"
}
],
"level": "error",
"timestamp": 1712461956369
},
Additional context
- Per reports of this error message on the Cloudflare side, it's expected: they don't allow
eval
uating for security and performance. - Similar report on Builder.io Forum: https://forum.builder.io/t/data-binding-works-in-builder-but-broken-on-deploy/5302
Thank you for the detailed report @ijustwannacodetoday ! We will let you know when we have an update on the root cause and/or have a workaround for you.
Hi @mrkoreye, has your team had a chance to review this? Is there an approximate timeline for getting this resolved? This is a blocker for my project, where I relied on Sections showing data (state) passed from my back end.
Hi @ijustwannacodetoday , unfortunately there is not approximate timeline for resolution at this time.