You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EDIT: I re-tested this replacing happy-dom with jsdom and it fixed it, so now I am open to the idea that this is a happy-dom issue and should be reported to their issues.
The minimal repro linked below is a fresh create-next-app with vitest, @testing-library/react, and happy-dom installed.
It looks like <Select.Content> specifically is the culprit, since removing it causes the render to be successful, but removing everything inside of it the test still fails.
Additional context
I will try with jsdom instead of happy-dom and report back. vitest (not jest) is a hard requirement for me though.
Your environment
"@radix-ui/react-select@^1.2.2":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@radix-ui/react-select/-/react-select-1.2.2.tgz#caa981fa0d672cf3c1b2a5240135524e69b32181"
integrity sha512-zI7McXr8fNaSrUY9mZe4x/HC0jTLY9fWNhO1oLWYMQGDXuV4UCivIGTxwioSzO0ZCYX9iSLyWmAh/1TOmX3Cnw==
[email protected]:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
"@testing-library/react@^14.0.0":
version "14.0.0"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-14.0.0.tgz#59030392a6792450b9ab8e67aea5f3cc18d6347c"
integrity sha512-S04gSNJbYE30TlIMLTzv6QCTzt9AqIF5y6s6SzVFILNcNvbV/jU96GeiTPillGQo+Ny64M/5PV7klNYYgv5Dfg==
The text was updated successfully, but these errors were encountered:
llllvvuu
changed the title
Select.Content causes @testing-library/react to fail with "TypeError: Cannot read properties of null (reading 'createElement')"Select.Content cannot render in happy-domMay 26, 2023
EDIT: I re-tested this replacing happy-dom with jsdom and it fixed it, so now I am open to the idea that this is a happy-dom issue and should be reported to their issues.
Yeah I was going to say that doesn't sound like a Radix issue to me, rather some kind of setup issue.
Bug report
EDIT: I re-tested this replacing
happy-dom
withjsdom
and it fixed it, so now I am open to the idea that this is ahappy-dom
issue and should be reported to their issues.The minimal repro linked below is a fresh
create-next-app
withvitest
,@testing-library/react
, andhappy-dom
installed.I put only the "Anatomy" code: https://www.radix-ui.com/docs/primitives/components/select#anatomy
And the test is just
Current Behavior
Expected behavior
<Select />
should renderReproducible example
https://github.com/llllvvuu/radix-ui-minimal-repro
CodeSandbox (open Terminal and type
yarn vitest
)Suggested solution
It looks like
<Select.Content>
specifically is the culprit, since removing it causes the render to be successful, but removing everything inside of it the test still fails.Additional context
I will try with
jsdom
instead ofhappy-dom
and report back.vitest
(notjest
) is a hard requirement for me though.Your environment
see
yarn.lock
for moreNode v18.16.0
yarn 1.22.19
MacOS Ventura 13.1 (M1)
The text was updated successfully, but these errors were encountered: