webcontainer-core icon indicating copy to clipboard operation
webcontainer-core copied to clipboard

Quotation marks automatically added incorrectly.

Open qmlowery opened this issue 1 year ago • 0 comments

Describe the bug

When trying to mess with an LWC, quotation marks keep getting added in my HTML. I even get an error telling me the quotation marks are incorrect: [!] (plugin rollup-plugin-lwc-compiler) Error: LWC1034: Ambiguous attribute value label="{material}". If you want to make it a valid identifier you should remove the surrounding quotes label={material}. If you want to make it a string you should escape it label="{material}".

But when I remove the quotes and hit save, they are automatically added back, causing the error to appear. The quotation marks were not present in the original code, and StackBlitz keeps inserting them.

Link to the blitz that caused the error

https://stackblitz.com/edit/salesforce-lwc-1meczd?file=src%2Fmodules%2Fx%2Fapp%2Fapp.js,src%2Fmodules%2Fx%2Fapp%2Fapp.html

Steps to reproduce

  1. copy this code into an lwc html file:
Name: {name}
Description: {description}
Price: {price}
  1. Hit save

Expected behavior

The code should copy without adding quotation marks to certain elements

Parity with Local

Screenshots

Before save: image

After save: image

Error asking me to remove the quotation marks: image

Platform

Browser name  = Chrome
Full version  = 123.0.0.0
Major version = 123
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 97262034,
  "usedJSHeapSize": 82908750,
  "jsHeapSizeLimit": 4294705152
}
Hash = 7dbe22a9

Additional context

No response

qmlowery avatar Apr 01 '24 21:04 qmlowery