lwc icon indicating copy to clipboard operation
lwc copied to clipboard

(template-compiler) Quote empty parentheses as attribute value fails compilation

Open ravijayaramappa opened this issue 1 year ago • 1 comments

Description

Attribute value of "{}" was previously not being treated as an expression value and hence passed compilation with out an error.

<template>
    <h1>Hello world!</h1>
    <div data-foo="{}"></div>
</template>

This change was introduced in this pr https://github.com/salesforce/lwc/pull/3376/files#diff-068f1f2f0aba9934781faf5a43f0a2eb38351062f092def1194e83c21cec689cR25

Steps to Reproduce

Use the markup provided with lwc v2.41.0 and it will throw a Ambiguous attribute value... error. Prior versions of lwc worked fine.

https://stackblitz.com/edit/salesforce-lwc-lhgqku?file=src%2Fmodules%2Fx%2Fapp%2Fapp.html,package.json&title=LWC%20playground

Version

  • LWC: 2.41.0

ravijayaramappa avatar Mar 26 '23 00:03 ravijayaramappa

@ravijayaramappa Can this be closed? Or is there still something to do?

nolanlawson avatar Aug 11 '23 17:08 nolanlawson

@ravijayaramappa Closing, as I believe you addressed this issue. Please reopen and update description with specifics if there is remaining work.

ekashida avatar Jul 02 '24 14:07 ekashida