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 throw Promise is undefined #1563

Open
silaike opened this issue Nov 28, 2020 · 5 comments
Open

IE11 throw Promise is undefined #1563

silaike opened this issue Nov 28, 2020 · 5 comments

Comments

@silaike
Copy link

silaike commented Nov 28, 2020

Description

IE11 throw Promise is undefined

Expected behavior

Promise should be polyfilled.

Actual behavior

IE11 throws any error in console.

Environment

React Hot Loader version: 4.13.0

Reproducible Demo

it works fine in 4.12.x

@theKashey
Copy link
Collaborator

React-Hot-Loader is not expected to work with IE11, as the latter was deprecated roughly a year ago.
However, there is question about polyfill and it's presence in your codebase

  • if it is missing - please add, library cannot do it
  • if it is not missing, but by any reason not applied before RHL uses Promises - that's a bug.

@silaike
Copy link
Author

silaike commented Nov 28, 2020

polyfill is not missing in my code, it works fine in React Hot Loader version: 4.12.x.

in React Hot Loader version: 4.13.0, it's throwing the error here:

Promise.resolve(incrementHot()).then(() => setTimeout(decrementHot, 0));

@theKashey
Copy link
Collaborator

That code was not changed in a last few years, the question is why this code is called before(?) polyfill initilization (so that sounds like a bug)

@moonjoungyoung
Copy link

I am having same issue.

webpack.config.js

    entry: [
      '@babel/polyfill',
      path.resolve(__dirname, './src/global/scripts/polyfills.js'),
      'react-hot-loader/patch',
      path.resolve(__dirname, './src/index.js'),
    ],

@theKashey
Copy link
Collaborator

please double-check that RHL is not patching your polyfills. Or even easier - check the stack trace of the error to find the file it's originated, and the position of that file in entry scripts.

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