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

SSR component render() toString method returns undefined #1044

Closed
dschulten opened this issue Dec 23, 2017 · 1 comment · Fixed by #1046
Closed

SSR component render() toString method returns undefined #1044

dschulten opened this issue Dec 23, 2017 · 1 comment · Fixed by #1046

Comments

@dschulten
Copy link

dschulten commented Dec 23, 2017

When using ${app.render()} in a template literal, I get undefined. That seems to be caused by a bug in toString():

var result = { head: '', addComponent: addComponent };
...
var html = AddToCart._render(result, state, options);
return {
    html: html,
    head: result.head,
    css: { code: cssCode, map: null },
    toString: function toString() {
        return result.html;                <-- probably should return html
    }
};

Workaround: use ${app.render().html} in template literals.

Rich-Harris added a commit that referenced this issue Dec 24, 2017
fix toString method in SSR output
@Rich-Harris
Copy link
Member

Your fix was entirely correct, of course 😀 released 1.49.3

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

Successfully merging a pull request may close this issue.

2 participants