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

Error when running test with react stitches -- needs TS4 #982

Closed
norman-ags opened this issue Mar 4, 2021 · 1 comment
Closed

Error when running test with react stitches -- needs TS4 #982

norman-ags opened this issue Mar 4, 2021 · 1 comment
Labels
kind: support Asking for support with something or a specific use case scope: dependencies Pull requests that update a dependency file solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue

Comments

@norman-ags
Copy link

norman-ags commented Mar 4, 2021

Current Behavior

yarn test throws an error: TypeError: Cannot read property 'length' of undefined

      TypeError: Cannot read property 'length' of undefined
      at TextImpl.get length [as length] (node_modules/jsdom/lib/jsdom/living/nodes/CharacterData-impl.js:28:23)
      at TextImpl.set data [as data] (node_modules/jsdom/lib/jsdom/living/nodes/CharacterData-impl.js:24:30)
      at Text.textNode [as data] (node_modules/jsdom/lib/jsdom/living/generated/CharacterData.js:248:24)
      at Set.onChange (node_modules/@stitches/react/src/index.js:16:64)
      at Set.addCss (node_modules/@stitches/core/src/CssSet.js:19:9)
      at expressThemedRule (node_modules/@stitches/core/src/index.js:73:16)
      at Function.assign [as className] (node_modules/@stitches/core/src/index.js:82:5)
          at assign (<anonymous>)
      at createCss (node_modules/@stitches/core/src/index.js:343:2)
      at Object.x (node_modules/@stitches/react/src/index.js:39:16)

I'm using react stitches to create my button component.
Project setup: https://github.com/norman-ags/tsdx-with-stitches

Expected behavior

Expected the test to pass

Additional context

I have tried this using CRA and the test runs fine.

Your environment

  System:
    OS: Windows 10 10.0.19041
    CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
    Memory: 7.65 GB / 15.93 GB
  Binaries:
    Node: 14.15.5 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 88.0.4324.190
    Edge: Spartan (44.19041.423.0), Chromium (88.0.705.81)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    tsdx: ^0.14.1 => 0.14.1
    typescript: ^4.2.2 => 4.2.2
@norman-ags
Copy link
Author

I fixed this by adding a resolution as suggested here: #926

@agilgur5 agilgur5 added kind: support Asking for support with something or a specific use case problem: no repro No reproduction was provided (and have not tried to repro without one) solution: workaround available There is a workaround available for this issue solution: duplicate This issue or pull request already exists and removed problem: no repro No reproduction was provided (and have not tried to repro without one) labels Mar 4, 2021
@agilgur5 agilgur5 changed the title Error when running test with react stitches Error when running test with react stitches -- needs TS4 Mar 6, 2021
@agilgur5 agilgur5 added the scope: dependencies Pull requests that update a dependency file label Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: support Asking for support with something or a specific use case scope: dependencies Pull requests that update a dependency file solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue
Projects
None yet
Development

No branches or pull requests

2 participants