Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"[Builder.io]: Failed code evaluation: Code generation from strings disallowed for this context" #3180

Open
ijustwannacodetoday opened this issue Apr 7, 2024 · 3 comments

Comments

@ijustwannacodetoday
Copy link

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:

  1. Create a Qwik app.
  2. Add a Cloudflare Pages adapter.
  3. In Builder, create a section model.
  4. 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'}}
  1. In Builder, in Content, add a New Entry for your section model.
  2. In Builder, in Editor, add the Basic > Text component.
  3. In Builder, in Options panel, bind text to dynamic data (state).
  4. In Builder, publish.
  5. 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

  1. Per reports of this error message on the Cloudflare side, it's expected: they don't allow evaluating for security and performance.
  2. Similar report on Builder.io Forum: https://forum.builder.io/t/data-binding-works-in-builder-but-broken-on-deploy/5302
@mrkoreye
Copy link
Collaborator

mrkoreye commented Apr 9, 2024

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.

@ijustwannacodetoday
Copy link
Author

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.

@mrkoreye
Copy link
Collaborator

Hi @ijustwannacodetoday , unfortunately there is not approximate timeline for resolution at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants