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.

This issue has already been asked previously. I will be as detailed as I can to provide enough information about the dev setup. Here I will paste one experiment with create-react-app, but I have tried this with a custom webpack/react project, and the result is the same.

Below is a simple create-react-app index.js, that I think most are familiar with:

import 'react-app-polyfill/ie11';
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();

and here is the App.js

import React, { Component } from 'react';
import "react-reflex/styles.css";
import { ReflexContainer, ReflexElement, ReflexSplitter } from "react-reflex";
import './App.css';

class App extends Component {
  render() {
    return (
      <div className="App">
        <ReflexContainer orientation="vertical" windowResizeAware={true}>
            <ReflexElement minSize={300} flex={0.2}>
                <div>Hello</div>
            </ReflexElement>
            <ReflexSplitter />
            <ReflexElement minSize={300} flex={0.2}>
                <div>hello 2222</div>
            </ReflexElement>
        </ReflexContainer>
      </div>
    );
  }
}

export default App;

And here is the standard package.json

{
  "name": "test-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.4.2",
    "react-app-polyfill": "^1.0.6",
    "react-dom": "^16.4.2",
    "react-reflex": "^3.0.22",
    "react-scripts": "1.1.5"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

This runs fine in most browsers, except for IE 11. Console provides the following error: image

and the syntax error its referring to is the following:

image

From the look of it I can only see that ES6 syntax has found its way to an ES5 transpiled bundle. As mentioned above, I have done this experiment both with create-react-app and a custom webpack/react environment, and the output are the same for both.

Is there any additional configuration that needs to be done here?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arash87commented, Mar 28, 2020

@wonskarol I ended up setting an alias in my webpack config to reference the commonjs build, instead of the es, as es is not transpiled to es5.

My webpack config did not exclude the /node_modules/ either, and still couldn’t transpile that es folder. The same goes with CRA project.

@leefsmp I can also confirm that the package.json is correct, meaning that module references an ES module, and not commonjs. The issue is that the module can’t be having ES6 features (classes, const) unless this library isn’t meant for IE. What I understand from the the “fuzzy” guidelines, is that when it comes to react components, the es bundle should still be transpiled to ES5.

0reactions
wonskarolcommented, Mar 24, 2020

I think package.json is correct, but the way you create files in es folder might be wrong - probably they should be transpiled to es5. I haven’t found clear answer for that, but this is my assumption

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems after installing Internet Explorer 11 - Microsoft Learn
Possible solutions to the problems you might encounter after installing IE11, such as crashing or seeming slow, getting into an unusable ...
Read more >
8 Most Common Internet Explorer Issues (And Easy Ways to ...
Here are some of the most common problems you may encounter with IE and quick and easy solutions for fixing them.
Read more >
How to fix CSS issues in IE11 (Internet Explorer 11)
The first thing to check for layout issues in IE11 is to make sure that your HTML and CSS is valid. This is...
Read more >
There is an issue with accessing remedy through Microsoft ...
MT 8.1 sp1 will provide a fix for IE11 – Remedy 8.1 does not load properly by default (using the “Edge” rendiering engine...
Read more >
Diagnosing IE11 performance issues within virtual ...
This issue can be exacerbated by a lack of JavaScript optimization in Internet Explorer 11 when compared to other browsers such as Google...
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