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

doesn't support ie11 #93

Closed
fred8617 opened this issue Sep 25, 2019 · 18 comments
Closed

doesn't support ie11 #93

fred8617 opened this issue Sep 25, 2019 · 18 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@fred8617
Copy link

image

@fred8617
Copy link
Author

i need to add these polyfills
import 'promise-polyfill/src/polyfill';
import 'unfetch/polyfill';
import 'abortcontroller-polyfill'
import 'url-search-params-polyfill';

@alex-cory
Copy link
Collaborator

alex-cory commented Sep 25, 2019

Will hop on this soon

@alex-cory
Copy link
Collaborator

@Fled8617 It sounds like you might be on a Microsoft computer since you're using IE. It's kind of a pain to test IE on mac. Would greatly appreciate if you could submit a PR!

@alex-cory
Copy link
Collaborator

I'm so excited I'm pretty sure I figured out a way to make this work.

@alex-cory
Copy link
Collaborator

alex-cory commented Mar 6, 2020

This might be fixed as of #196
As soon as I get a windows machine I'll test this, but until then, anyone who has a windows machine who might be able to confirm that this works, please comment on here so I can close this.

@Akswii
Copy link

Akswii commented Mar 8, 2020

It's not working for ie11 without the polyfills mentioned by @fred8617

@alex-cory
Copy link
Collaborator

Mind submitting a PR @Akswii? I removed the Proxy so it shouldn't be too far off.

@Akswii
Copy link

Akswii commented Mar 9, 2020

Sorry, I don't have the time to look into it. Included the polyfills and got it working for my project. I appreciate your work @alex-cory 🙏

@alex-cory
Copy link
Collaborator

@Akswii so you didn't need to add a polyfill for Object.entries?

@Akswii
Copy link

Akswii commented Mar 10, 2020

image
These are my current polyfills. I think a polyfill for Object.entries is included in one of the CRA polyfills.

@alex-cory alex-cory added enhancement New feature or request help wanted Extra attention is needed labels Mar 10, 2020
@Akswii
Copy link

Akswii commented Mar 11, 2020

image
I double checked, Object.entries is not polyfilled with the react-app-polyfill, nor in any of the other packages as far as I can tell. Not sure if this is helpful or not @alex-cory

@alex-cory
Copy link
Collaborator

alex-cory commented Mar 11, 2020

@Akswii I'll make a branch, but could you pull down the branch and test it on your windows machine? Steps

git clone git@github.com:alex-cory/use-http.git
cd ./use-http
git checkout ie-support
yarn
yarn link
cd ..
create-react-app use-http-cra-app
cd ./use-http-cra-app
yarn
yarn link use-http
cd ../use-http
npm link ../use-http-cra-app/node_modules/react
npm link ../use-http-cra-app/node_modules/react-dom
cd ../use-http-cra-app
yarn start

Now just go into your use-http-cra-app/src/App.js and import use-http and test it in ie. I still need to make the ie-support branch so bare with me.

@Akswii
Copy link

Akswii commented Mar 11, 2020

I had to do yarn build in use-http to make the test project work.

After adding the basic cra-app polyfill it seems like your ie-support fix branch is working. No need for me to polyfill anything extra. Tested in internet explorer 11. Nice! 🔥

@alex-cory
Copy link
Collaborator

I'm so excited

@alex-cory
Copy link
Collaborator

alex-cory commented Mar 18, 2020

@Akswii when you say the basic cra-app polyfill, you are saying put these in the useFetch.ts?

import 'react-app-polyfill/ie11'
import 'react-app-polyfill/stable'

I might just put this in the documentation. If you need ie11 support, use these polyfills. Or... maybe I just import them, and just have them as devDependencies, then will just use them at build time. 🤔 Thoughts?

@Akswii
Copy link

Akswii commented Mar 19, 2020

@alex-cory correct. Yes you can do that / just have a link or reference to the react docs as they cover this if you want to be ie11 compatible.

@Akswii
Copy link

Akswii commented Mar 19, 2020

If people are going to start testing their react app on explorer then it will crash because of react issues before it reaches your fetch library.

@alex-cory alex-cory changed the title don support ie11 doesn't support ie11 Mar 19, 2020
@alex-cory
Copy link
Collaborator

So anyone trying to get this to work in IE, just add these lines to the top of your main/root App.js file.

import 'react-app-polyfill/ie11'
import 'react-app-polyfill/stable'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants