4

I cannot seem to resolve why I'm receiving this error: Here are my configs:

lang-js
react - 15.3.1
react-dom - 15.3.1
react-testing-library - 6.0.0
jest - 23.6.0

lang-js
import React from 'react';
import { render, fireEvent, cleanup } from 'react-testing-library';

afterEach(cleanup);

test('loads and displays ', async() => {

})

I commented on an open GH issue on the react-testing-library page. Thanks in advance

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
eagercoder
  • 526
  • 1
  • 10
  • 23

1 Answers1

2

This may have happened if something got modified or deleted in your react-dom dependency package.

Using yarn

You can verify that already installed files in node_modules did not get removed, reinstalling any missing files by using:

npm install --check-files

That should help you restore react-dom to what it should be.

If that doesn't work, you can always try to completely remove and reinstall all of your packages. From your project root folder, try:

rm -rf node_modules
yarn install

Using npm

First, you can try just to install react-dom again. That might solve your problem:

npm install react-dom

If that doesn't work, then you can try to reinstall all of your packages to get a fresh copy.

From your project root folder, try:

rm -rf node_modules
npm install
Alvin S. Lee
  • 4,984
  • 30
  • 34
  • 1
    I removed my `node_modules` folder, and that didnt fix it. The fix was to add `^` to my react dependencies: react - ^15.3.1, react-dom - ^15.3.1 – eagercoder Mar 18 '19 at 19:52
  • 1
    @eagercoder I'm glad you found a workable solution to your issue! Happy coding! – Alvin S. Lee Mar 19 '19 at 02:11