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

Enzyme Internal Error: unknown node with tag 12 #1620

Closed
2 of 4 tasks
kkwiatkowski opened this issue Apr 13, 2018 · 13 comments
Closed
2 of 4 tasks

Enzyme Internal Error: unknown node with tag 12 #1620

kkwiatkowski opened this issue Apr 13, 2018 · 13 comments

Comments

@kkwiatkowski
Copy link

kkwiatkowski commented Apr 13, 2018

Current behavior

React in version 16.3 introduces new Context API. That API comes with two new node types (12 and 13).
These node types are not supported and therefore enzyme-adapter-react-16 is throwing an error:

# for ContextConsumer
Enzyme Internal Error: unknown node with tag 12

or

# for ContextProvider
Enzyme Internal Error: unknown node with tag 13

when you use Context API inside your React components.

An example:

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

const { Provider, Consumer } = React.createContext();
const Component = () => (
  <Provider value="test">
    <Consumer>{value => <span>{value}</span>}</Consumer>
  </Provider>
);

mount(<Component />); // this will thrown an error mentioned earlier

Expected behavior

New node types are handled correctly.

API

  • shallow
  • mount
  • render

Version

library version
Enzyme ^3.3.0
React ^16.3.0

Adapter

  • enzyme-adapter-react-16
@ghost
Copy link

ghost commented Apr 16, 2018

@kkwiatkowski this is a duplicate of #1509, which has already been fixed by #1513. Just waiting on a release by enzyme 😢

@kkwiatkowski
Copy link
Author

@baldwmic thanks for your answer. For some reason I couldn't find anything around it.

@KaiHotz
Copy link

KaiHotz commented Jul 24, 2018

Did this fix get released yet?
I still have this problem on Enzyme v3.3.0 with enzyme-adapter-react-16 v 1.1.1

@ljharb
Copy link
Member

ljharb commented Jul 24, 2018

No, not yet. Please be patient.

@dzearing
Copy link

Sorry to ping here, but any ETA on the release? This is blocking a lot of people, I'd suspect. Basically we aren't able to move to the new context without breaking existing enzyme tests.

@ljharb
Copy link
Member

ljharb commented Jul 31, 2018

No ETA just yet. I understand the frustration and that it's blocking many people, including Airbnb, from using many of React 16's new features.

It will be released as soon as it's ready.

@nhunzaker
Copy link

@ljharb just chiming in to say thanks for taking the time to do it right. Enzyme is an amazing library!

@msluther
Copy link

msluther commented Aug 2, 2018

@ljharb Is there an issue we can follow that isn't closed to check on the progress of a fix here getting published?

@ljharb
Copy link
Member

ljharb commented Aug 2, 2018

@msluther #1553

@msluther
Copy link

msluther commented Aug 2, 2018

@ljharb Thank you! 😄

@ljharb
Copy link
Member

ljharb commented Aug 8, 2018

The following packages are now released:

@Fl4v10
Copy link

Fl4v10 commented May 14, 2019

I got this problem with "enzyme": "^3.9.0"

@ljharb
Copy link
Member

ljharb commented May 14, 2019

@Fl4v10 please file a new issue

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

7 participants