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

Polyfill not working as expected for IE11 #10635

Closed
ChuckJonas opened this issue Feb 21, 2020 · 4 comments
Closed

Polyfill not working as expected for IE11 #10635

ChuckJonas opened this issue Feb 21, 2020 · 4 comments

Comments

@ChuckJonas
Copy link

ChuckJonas commented Feb 21, 2020

Bug report

Describe the bug

I keep reading that IE11 is polyfilled "out of the box", however, I'm running into issues where that does not seem to be the case.

The error is NOT coming from a library, but directly from my react component.

TypeError: Object doesn't support property or method 'find'
Anonymous function
./src/pages/profile.tsx:53
  50 | const AccountRoles = (props: { user: User; accounts: Account[] }) => {
  51 |   const { user, accounts } = props;
  52 |   const allRoles = accounts.reduce((roles, acc) => {
> 53 |     const accUser = acc.contactRelations.find(cr => cr.id === user.id);
  54 |     if (!accUser || !accUser.roles) {
  55 |       return roles;
  56 |     }

contactRelations is an array.

To Reproduce

I don't have IE11 but and my app is big and complex so I'm not sure how to create a reproducible example.

  1. run find() method on array
  2. Open in IE11

Expected behavior

I expect that it should polyfill the find method

System information

  • OS: Windows
  • Browser: IE 11
  • Version of Next.js: 9.2.0

Additional context

I've also tried to polyfill this by following the with-polyfills example, but that doesn't work either. When I try to follow the example, I get an error Module not found: Can't resolve 'core-js/library/fn/object/assign'

@Timer
Copy link
Member

Timer commented Feb 21, 2020

Please try next@canary.

@ChuckJonas
Copy link
Author

I don't have a window machine, and the dev who found the bug is out for the day.

Will try first thing tomorrow.

FYI: I got the polyfill example to work. For some reason I had to put the entry changes at the bottom of my next.config.js, even though I wasn't modifying entry in any other way.

@ChuckJonas
Copy link
Author

I was able to figure out how to test. Looks like upgrading did fix the issue

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants