0

After upgrading to webpack 4 and latest react version . When i open react js development version on IE it shows blank page and shows following error in console.

SCRIPT1002: Syntax error
File: 0-9c5f892beeb9f5dfc76b.chunk.js, Line: 2891, Column: 34

and above line mentioned below code :

"use strict";
/* WEBPACK VAR INJECTION */(function(module) {
const colorConvert = __webpack_require__(/*! color-convert */ "./node_modules/color-convert/index.js");

const wrapAnsi16 = (fn, offset) => function () {
    const code = fn.apply(colorConvert, arguments);
    return `\u001B[${code + offset}m`;
};

I have tried below solutions but nothings works for me :

https://reactjs.org/docs/javascript-environment-requirements.html

Why IE 11 display blank page rendering react app

Anand Neema
  • 592
  • 1
  • 3
  • 21
  • That looks like `node_modules` is not being transpiled via `babel` – P Varga Feb 13 '19 at 10:43
  • @pete but all modules are compiling other that this color-convert and ansi-styles – Anand Neema Feb 13 '19 at 12:05
  • Most packages from `node_modules` don't need transpilation, but there are some exceptions. You could also ask the `color-convert` authors to publish an ES5 build – P Varga Feb 13 '19 at 12:09
  • @pete is there any work around for this even i have manually mentioned this while compiling – Anand Neema Feb 13 '19 at 12:34
  • Is `node_modules` excluded under the `babel-loader` rule in webpack config? If yes change that exclude rule to something like `node_modules/(?!color-convert)` – P Varga Feb 13 '19 at 12:38
  • @pete No it's not excluded – Anand Neema Feb 14 '19 at 09:07
  • 1
    @pete I have provided presets with rules then it gets complied in IE 11 but not in IE10 and IE 9 getting Map is undefined then i have used https://reactjs.org/docs/javascript-environment-requirements.html but not works any suggestions regarding this. – Anand Neema Feb 14 '19 at 10:22
  • Hm, I would have thought importing `core-js/es6/map` would take care of that. What is the stacktrace? – P Varga Feb 14 '19 at 11:07

0 Answers0