Skip to content

Object.entries is not a function when importing react-testing-library #110

Closed
@snekse

Description

@snekse

Reporting this as an issue along with the fix in hopes that it helps others find the answer quicker.

Problem
When importing react-testing-library and running my tests, they failed with the following error

Object.entries is not a function

Version Information

  • react-testing-library version: 3.1.4
  • react version: N/A
  • node version: 6.x
  • npm (or yarn) version: 6.x

Solution

Per @kentcdodds suggestion in a glamorous ticket:

Make sure you're on the latest stable node (>=8) and npm (>= 5). Sorry about that!

Upgrading to the latest version of node did indeed resolve my issue.

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