Enzyme Internal Error: unknown node with tag 2
See original GitHub issueCurrent behavior
` Enzyme Internal Error: unknown node with tag 2
19 | ): ReactWrapper => {
20 | const el = (): JSX.Element => component;
> 21 | return mount(<Provider store={store}>{el()}</Provider>);
| ^
22 | };`
from:
import { shallow, ShallowWrapper, mount, ReactWrapper } from "enzyme";
import React, { ReactElement } from "react";
import { Provider } from "react-redux";
import { MockStoreEnhanced } from "redux-mock-store";
export const shallowWithStore = (
component: ReactElement,
store: MockStoreEnhanced
): ShallowWrapper => {
const context = {
store
};
return shallow(component, { context });
};
export const mountWithStore = (
component: ReactElement,
store: MockStoreEnhanced
): ReactWrapper => {
const el = (): JSX.Element => component;
return mount(<Provider store={store}>{el()}</Provider>);
};
I’m using react-i18next
and suspect it could be to do with the export:
export default withTranslation()(
withRouter(
connect(
mapStateToProps,
mapDispatchToProps
)(HomePage)
)
);
Expected behavior
No error.
API
- shallow
- mount
- render
Version
library | version |
---|---|
enzyme | 3.9.0 |
react | 16.8.5 |
react-dom | 16.8.4 |
react-test-renderer | |
adapter (below) | 1.13.0 |
Adapter
- enzyme-adapter-react-16
- enzyme-adapter-react-16.3
- enzyme-adapter-react-16.2
- enzyme-adapter-react-16.1
- enzyme-adapter-react-15
- enzyme-adapter-react-15.4
- enzyme-adapter-react-14
- enzyme-adapter-react-13
- enzyme-adapter-react-helper
- others ( )
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
React unit test - Enzyme Internal Error: unknown node with tag 2
React unit test - Enzyme Internal Error: unknown node with tag 2 ... Need help to resolve this issue. reactjs · jestjs ·...
Read more >Enzyme Internal Error: unknown node with tag 2 - Bountysource
Getting error Enzyme Internal Error: unknown node with tag 2. from mounting Suspense component with child component that throws promise:
Read more >enzymejs/enzyme - Gitter
<div data-test="selectClosedDropDown" className={css(styles.value(error, ... (Mac OS X 10.15.6) Error: Enzyme Internal Error: unknown node with tag 15
Read more >Unknown Node With Tag 15 Using React Boiler Plate - ADocLib
Enzyme Internal Error : Unknown Node With Tag 15 Using React Boiler Plate ... code ELIFECYCLE npm ERR! errno 1 Code Answer's Step...
Read more >Top 5 enzyme-adapter-utils Code Examples - Snyk
Learn more about how to use enzyme-adapter-utils, ... default: throw new Error(`Enzyme Internal Error: unknown node with tag ${node.tag}`); } }.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Working on the repro test case. I’ll upload when I have it ready.
I’m not sure what
Fetch
is (unless you meanfetch
) - did this happen because you rendered a Promise?