Template Literal Error in Widget (Utah Scoped App)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2023 02:09 PM
My instance is on Utah and I'm attempting to use basic template literals in the client controller of a widget. The widget was created in a scoped application for which ES12 is enabled. The line on which the template literal is declared generates the following warning ('template literal syntax' is only available in ES6 (use 'esversion: 6').):
This is the code:
let message = "testing template literals";
let fullMessage = `This is my message: ${message}`;
console.warn(fullMessage);
It's worth noting that variables declared with 'let' are interpreted correctly and can be logged to the console, but the template literal displays as plain text, ignoring the template literal syntax:
This is my message: message is logged instead of This is my message: testing template literals
Any ideas why this is happening? Is there another setting that I need to toggle aside from the Javascript Mode in the application config?
- 501 Views