Skip to content

TypeError when rendering Object.create(null) #4785

Open
@nolanlawson

Description

@nolanlawson
<template>
    {obj}
</template>
export default class extends LightningElement {
  obj = Object.create(null)
}

The above errors out with TypeError: Cannot convert object to primitive value.

This is a niche use case, because if you use obj = {} then it renders [object Object] instead. But maybe we should support this?

Repro

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions