The Wayback Machine - http://web.archive.org/web/20200604001047/https://github.com/marko-js/marko/issues/1501
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

Named body content without ".renderBody" broken in marko >= 4.18.36 #1501

Open
MuwuM opened this issue Feb 14, 2020 · 0 comments
Open

Named body content without ".renderBody" broken in marko >= 4.18.36 #1501

MuwuM opened this issue Feb 14, 2020 · 0 comments

Comments

@MuwuM
Copy link

@MuwuM MuwuM commented Feb 14, 2020

Marko Version: 4.18.36

still broken in 4.18.46

Details

In your documentation you write:

ProTip: The renderBody property can be omitted. You could use <${input.heading}/>, for example.

Expected Behavior

When I do this it works fine in marko <= 4.18.35

Actual Behavior

but fails with error "Invalid dynamic tag value" in marko >= 4.18.36

Workaround

appending .renderBody fixes this error in marko >= 4.18.36 <= 4.18.46

Additional Info

Your Environment

  • Tested with Firefox 73.0 (browser) and node.js 12.16 (backend) using koa 2.11.0 (framework)
  • Windows desktop client, alpine linux server

Steps to Reproduce

  1. follow https://markojs.com/docs/body-content/#named-body-content
  2. remove the .renderBody as mentioned in the ProTip

Stack Trace


Error: Error: Invalid dynamic tag value 3 index-8f34d635.js:83:19
    emit /static/pages-all/events-light$1.0.5/src/index-8f34d635.js:83
    Marko 15
        emit
        error
        dynamicTag
        render
        forOf
        render
        renderer
        ___rerender
        ___scheduleRerender
        batchUpdate
        ___scheduleRerender
        update
        updateComponents
        updateUnbatchedComponents
        <anonym>

Further investigation

The error is probably thrown beause this if fails: link

so maybe it helps to also check wheter the renderer has a .renderBody property if it is not a function. But I cannot make sure whether this would be the only place that would need to be modified for a proper solution.

Also it seems to render fine on Server-Side, but fails client side (probably already during hydration)

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.