ES6 Syntax Error

Bronze Contributor
Bronze Contributor


My team is encountering intermittent errors when we use ES6 template literals. It is causing syntax errors and does not allow for our utag.js to compile. According to this post ES6 is supported: Solved: Does custom Javascript extension support ES6/ECMAS... - Tealium Learning Center (tealiumiq.c...

This only happens in some of our files and not others. Are template literals not supported by tealium? Or is there a fix for this?

For example: 

const url = `${window.location.protocol}//${}${window.location.pathname}`;
When tealium compiles this is compiles to `${window.location.protocol}  and truncates everything after the first closing bracket. This leaves the string unterminated and causes the compile error. 



ES6 Syntax Error

Tealium Employee

Tealium does support ES6 but if the minification setting is enabled in the profile's publish settings, the ES6 will not compile properly and will not work (this setting is enabled by default). There also might be some cases in the Github sync where ES6 can cause issues. With these issues in mind, we do recommend using ES5 and below if possible. I'm not sure if we have any requests in with our team to correct these issues, as they are not commonly reported. You can always submit a product idea to increase the complete support of ES6 across Tealium products. 

Jen Kaye
Senior Premium Success Engineer | Tealium, Inc.

ES6 Syntax Error

Bronze Contributor
Bronze Contributor

Thanks for the quick response @jenniferkaye!

I will submit a product idea. Just kind of surprising that it does not fully support ES6 when minifying. 

Do you have any documentation on what ES6 features are/aren't fully supported in Tealium?

We are moving to ES6 for our coding standard and want to avoid any potential issues. 

Thanks again for the help.