You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tsc -v 1.7.5
When compiling for es6 target, with let, const, etc., and using commonjs module, browser (Chrome) complains about let and co. used outside of "strict mode" zone. Adding "use strict" at the beginning of commonjs module should fix this.
Note:
spec for es6, 10.2.1 Strict Mode Code says that "Module code is always strict mode code". This assumes that es6 modules are used, while commonjs' require()'s look differently.
it does not seem to be a problem with node, as it probably relaxes this rule.
Babel's transform-es2015-modules-commonjs inserts "use strict" at the start of the file, satisfying browser's desire to stick to the standard's rule, and it all just works. Unfortunately, this requires a babel step in the build :(
The text was updated successfully, but these errors were encountered:
Hey @3n-mb, this seems to be a duplicate of #3576. You can give our nightlies a try by installing npm install -g typescript@next and seeing the new behavior there.
tsc -v 1.7.5
When compiling for es6 target, with let, const, etc., and using commonjs module, browser (Chrome) complains about let and co. used outside of "strict mode" zone. Adding "use strict" at the beginning of commonjs module should fix this.
Note:
The text was updated successfully, but these errors were encountered: