elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.64k stars 8.23k forks source link

Warning: React does not recognize the `dataTestSubj` prop on a DOM element on main #149818

Open bhavyarm opened 1 year ago

bhavyarm commented 1 year ago

Kibana version: main

Elasticsearch version: main

Browser version: chrome latest

Browser OS version: OS X

Original install method (e.g. download page, yum, from source, etc.): from source

Describe the bug: Kibana displays this warning in dev console.

Warning: React does not recognize the `dataTestSubj` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `datatestsubj` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    at a
    at http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:174471:73
    at http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:80746:24
    at http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:174471:73
    at EuiButton (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:80549:25)
    at div
    at div
    at EuiCollapsibleNavGroup (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:84294:24)
    at div
    at http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:174471:73
    at EuiFlexItem (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:111980:23)
    at nav
    at http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:174471:73
    at div
    at http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:364442:59
    at FocusLockUI (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:360745:71)
    at http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361648:60
    at EuiFocusTrap (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:112985:81)
    at EuiPortal (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:141606:81)
    at http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:112244:24
    at EuiCollapsibleNav (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:84155:17)
    at CollapsibleNav (http://localhost:5620/9007199254740991/bundles/core/core.entry.js:10852:3)
    at div
    at EuiHeaderSectionItem (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:121457:26)
    at div
    at EuiHeaderSection (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:121398:24)
    at div
    at EuiHeader (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:120781:23)
    at div
    at header
    at Header (http://localhost:5620/9007199254740991/bundles/core/core.entry.js:11173:3)
    at CurrentEuiBreakpointProvider (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:165358:23)
    at EuiThemeProvider (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:170450:22)
    at EuiCacheProvider (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:142028:20)
    at EuiProvider (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:142128:25)
    at CoreThemeProvider (http://localhost:5620/9007199254740991/bundles/core/core.entry.js:21729:3)
    at EuiContext (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:90100:24)
    at PseudoLocaleWrapper (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:14127:5)
    at IntlProvider (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:149308:5)
    at I18nProvider (http://localhost:5620/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:14058:3)
    at I18nContext (http://localhost:5620/9007199254740991/bundles/core/core.entry.js:16376:9)
    at CoreContextProvider (http://localhost:5620/9007199254740991/bundles/core/core.entry.js:21657:3)

Its strange to see this warning about test infrastructure?

elasticmachine commented 1 year ago

Pinging @elastic/eui-design (EUI)

cee-chen commented 1 year ago

@bhavyarm I suspect that this is not an EUI bug but a dev in Kibana accidentally passing in dataTestSubj="foo" vs data-test-subj="foo" to an EUI component (which gets passed as-is via ...rest spread).

The stacktrace isn't terribly helpful in pointing to the source code usage - any chance you can provide either a local dev link where this error appears?