Template Literal Error in Widget (Utah Scoped App)

joshuartx
Tera Contributor

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').):

 

joshuartx_0-1685826260357.png

 

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?

0 REPLIES 0