Parcel: [TypeScript] Runtime error in IE 11

Created on 11 Dec 2017  路  2Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

馃帥 Configuration (.babelrc, package.json, cli command)

tsconfig.json :

{
  "compilerOptions": {
    "module": "commonjs",
    "lib": [
      "dom",
      "es2015.promise",
      "es5"
    ],
    "target": "es5",
    "noImplicitAny": false,
    "sourceMap": true
  }
}

Main.ts

alert("typescript works!");

index.js

import "./ts/Main.ts";

index.html

<!doctype html>
<html>
<head>
  <script src="index.js"></script>
</head>
<body>
</body>
</html>

馃 Expected Behavior

works in IE 11


馃槸 Current Behavior

does not works in IE 11



馃拋 Possible Solution


I guess arrow function in compiled code is the reason

module.bundle.Module = Module;

if (!module.bundle.parent) {
  var ws = new WebSocket('ws://localhost:59462/');
  ws.onmessage = (e) => {
    var data = JSON.parse(e.data);

https://github.com/parcel-bundler/parcel/blob/0ff76bea36135a4b1edbd85a588a4e26c86dcc19/src/builtins/hmr-runtime.js#L19

馃敠 Context


馃實 Your Environment

| Software | Version(s)
| ---------------- | ----------
| Parcel | 1.1.09
| Node | 9.1.0
| npm/Yarn | npm 5.5.1
| Operating System | macOS High Sierra 10.13.1

Most helpful comment

It seems to be related with #169

All 2 comments

It seems to be related with #169

Closed by #169 (merged)

Feel free to reopen if you think I closed this issue in error :)

Was this page helpful?
0 / 5 - 0 ratings