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

Nx test fails after creation of stencil library #309

Closed
TimSeyschab opened this issue Sep 11, 2021 · 4 comments
Closed

Nx test fails after creation of stencil library #309

TimSeyschab opened this issue Sep 11, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@TimSeyschab
Copy link

After creating a new empty nx workspace and creating a stencil library (nx g @nxext/stencil:lib my-lib), jest throws the following error.

$ nx run my-lib:test --verbose

>

> nx run my-lib:test --verbose 
[47:28.6]  testing spec  #files
[47:28.6]  jest args: --projectType=library --tsConfig=libs/my-lib/tsconfig.lib.json
           --configPath=libs/my-lib/stencil.config.ts --outputPath=dist/libs/my-lib --spec --max-workers=8

[ ERROR ]  runJest: TypeError: Class extends value #<Object> is not a constructor or null



Test Suites: 0 of 2 total
Tests:       0 total
Snapshots:   0 total
Time:        0 s
———————————————————————————————————————————————

>  NX   ERROR  Running target "my-lib:test" failed

  Failed tasks:

  - my-lib:test

  Hint: run the command with --verbose for more details.

here is the package.json
package.txt

@TimSeyschab TimSeyschab added the bug Something isn't working label Sep 11, 2021
@ChrisKeck
Copy link

ChrisKeck commented Sep 11, 2021

I also had this problem when migrating from NX11 to NX12. The cause was incompatible Jest dependencies. After all Jest dependencies (important: Jest@26) were compatible with each other , it worked again. The only pain point is the non-migrated version of the plugin. I can only run it in version 11. All other NX plugins are version 12 :-( In my opinion, this is because: NX 12 brings Jest with version 27. Jest 27 does not yet work with StencilJS, see stenciljs/core#2942 or stenciljs/core#2922. As soon as stenciljs has solved the problem, hopefully this problem has also been solved!
If anyone disagrees or has additional information, please share

@DominikPieper
Copy link
Member

The main problem here is definitely the jest version. Something I try to override but unfortunately Nx does set the version of jest to 27. I wait for the stencil fix here eagerly

@TimSeyschab
Copy link
Author

TimSeyschab commented Sep 12, 2021

Using NX11 does work. Thank you Chris for linking to the issue in stencil-js. I'll wait with the migration to 12 until they fixed the issue

@DominikPieper
Copy link
Member

Today Stencil 2.13 came out with support for jest 27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants