question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Neutrino: Template literals do not work when targeting IE 11

See original GitHub issue

If I target the browser ie 11 in my babel-preset-env config, then the translation which are based on template literals do not work. I think it’s because babel-preset-env pulls in transform-es2015-template-literals. It generates then code like this:

var _templateObject = _taggedTemplateLiteral(['This field is required'], ['This field is required']),
    _templateObject2 = _taggedTemplateLiteral(['Valid email required'], ['Valid email required']);

var defaultMessages = exports.defaultMessages = function defaultMessages(i18n) {
  return {
    isRequired: i18n.t(_templateObject),
    isEmail: i18n.t(_templateObject2)
  };
};

Without the transform-es2015-template-literals plugin, it creates code like:

const defaultMessages = i18n => ({
  isRequired: i18n._('This field is required'),
  isEmail: i18n._('Valid email required')
});

If I’m right then you transform also template literals t function calls, but now the transform-es2015-template-literals comes first and your transformation cannot be processed.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
akkiecommented, Jul 11, 2017
presets: [
  'lingui-react',
  ['babel-preset-env', {

This works for me. But You’re right. This should be easier.

0reactions
tricoder42commented, Jul 11, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

Template literals syntax is not working in IE11 - Stack Overflow
If you look at the ECMAScript 6 compatibility table, you'll see that template literals are not supported by IE11. The "use strict" ...
Read more >
Cross Browser Compatibility of ES6 Template Literals ...
ES6 Template Literals (Template Strings) is Not Supported on Internet Explorer 11. Checkout overall cross browser compatibility of ES6 ...
Read more >
Neutrino EK Spotted Leveraging Patched IE Zero Day - Vulners
Attackers behind the Neutrino Exploit Kit didn't take long to co-op a recently patched Internet Explorer zero-day into its arsenal.
Read more >
Targeting ultra-high energy neutrinos with the ARIANNA ...
We report on the detector capabilities to determine the neutrino direction by reconstructing the signal arrival direction of a 800m deep ...
Read more >
Template literals (Template strings) - JavaScript | MDN
However, a tagged template literal may not result in a string; it can be used with a custom tag function to perform whatever...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found