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

React 16.0.0-alpha.3 support - "react-dom is an implicit dependency in order to support react@0.13-14" #1018

Closed
VanDavv opened this issue Jul 1, 2017 · 1 comment

Comments

@VanDavv
Copy link

VanDavv commented Jul 1, 2017

I'm starting new React project and I wan't to use bleeding edge versions of it, which is currently 16.0.0-alpha.3. When running tests, using latest enzyme and jest frameworks, I get the following error:

 react-dom is an implicit dependency in order to support react@0.13-14. Please add the appropriate version to your devDependencies. See https://github.com/airbnb/enzyme#installation

  at Object.<anonymous> (node_modules/enzyme/build/react-compat.js:108:11)
  at Object.<anonymous> (node_modules/enzyme/build/Utils.js:65:20)
  at Object.<anonymous> (node_modules/enzyme/build/MountedTraversal.js:36:14)
  at Object.<anonymous> (node_modules/enzyme/build/ReactWrapper.js:35:25)
  at Object.<anonymous> (node_modules/enzyme/build/index.js:6:21)
  at Object.<anonymous> (src/components/Dashboard.test.js:2:15)

Error appears when writting the following import

import {shallow} from 'enzyme';

In a basic example of test case

import React from 'react';
import {shallow} from 'enzyme';

it('should render a label', () => {
    const wrapper = shallow(
        <label>Hello Jest!</label>
    );
    expect(wrapper).toMatchSnapshot();
});

My package.json looks like this (removed packages that I think are unrelated)

"devDependencies": {
    "babel-core": "6.25.0",
    "babel-jest": "20.0.3",
    "babel-loader": "7.1.1",
    "babel-preset-react-app": "3.0.1",
    "babel-runtime": "6.23.0",
    "enzyme": "2.9.1",
    "jest": "20.0.4",
    "react-dev-utils": "3.0.1",
    "webpack": "3.0.0",
  },
  "dependencies": {
    "prop-types": "^15.5.10",
    "react": "16.0.0-alpha.3",
    "react-dom": "16.0.0-alpha.3",
  },

And I'm running tests using command
jest --env=jsdom --watch

Any idea if I can get it working with React 16.0.0-alpha.3 ?

@jwbay
Copy link
Contributor

jwbay commented Jul 2, 2017

See #928

@ljharb ljharb closed this as completed Jul 2, 2017
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