Skip to content

Polyfill not working as expected for IE11 #10635

Closed
@ChuckJonas

Description

@ChuckJonas

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions