Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE11 Support #13

Open
akarpas opened this issue Jun 24, 2019 · 5 comments
Open

IE11 Support #13

akarpas opened this issue Jun 24, 2019 · 5 comments

Comments

@akarpas
Copy link
Contributor

akarpas commented Jun 24, 2019

It seems the current setup of the boilerplate / webpack does not support IE11. The following error is produced:

IE: Error: Unable to get property 'apply' of undefined or null reference.

I tried updating the babel-polyfill but it seems nothing is working. Any advice?

@leonardomso
Copy link
Owner

Well, I think this might be a problem, don't know how to fix that yet 😐

@akarpas
Copy link
Contributor Author

akarpas commented Jun 24, 2019

@leonardomso from a quick look (or 1-2 hours now 😄 ) I believe its the redux devtools, i changed it to this:

import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly';
import thunk from 'redux-thunk';
import logger from 'redux-logger';

import rootReducer from './reducers';

const middleware = applyMiddleware(thunk, logger);

// const reduxDevTools =
//     window.__REDUX_DEVTOOLS_EXTENSION__ &&
//     window.__REDUX_DEVTOOLS_EXTENSION__()

const store = createStore(
    rootReducer,
    composeWithDevTools(
        middleware
    )
);

export default store;

One other step I have taken (but which did not produce results) was to add a CDN script import in index.html to import polyfills
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.4.4/polyfill.min.js"></script>

As I said this CDN was not fixing the issue, had to change the dev tools - but I am keeping it for backup, as i need my app to run on IE11. This was apparently suggested by a number of people.

@leonardomso
Copy link
Owner

Well, if you find any solution for this issue, feel free to send a PR, I'll love to merge

@eclectic-coding
Copy link
Contributor

Okay, so I have been reviewing this issue some this morning.

From the Core-js repo:

@babel/polyfill IS just the import of stable core-js features and regenerator-runtime for 
generators and async functions, so if you load @babel/polyfill - you load the global version 
of core-js without ES proposals.

The problem, as you know, is the needed polyfill for legacy browsers. I do not have a way to test, since I do not have a IE11 system, but it looks like react-app-polyfill might be a good fit for the legacy systems. It would be as simple as installing the package, and including in the first line of src/index.js:

// This must be the first line in src/index.js
import 'react-app-polyfill/ie11';

@leonardomso
Copy link
Owner

Wow, thanks for that @eclectic-coding. I will see if I can find some time this week to do some upgrades in this boilerplate and include the react-app-polyfill for IE11 support. Thanks, man.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants