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

[2.6.0] jest can't resolve lerna dependencies (sym links) #2221

Closed
bitflower opened this issue Feb 26, 2020 · 7 comments
Closed

[2.6.0] jest can't resolve lerna dependencies (sym links) #2221

bitflower opened this issue Feb 26, 2020 · 7 comments

Comments

@bitflower
Copy link
Contributor

bitflower commented Feb 26, 2020

Stencil version:

 @stencil/core@2.0.3

I'm submitting a:

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:
Currently jest has issues resolving internal lerna-sym-linked packages. They work during normal build (both dev and prod). After researching and trying many possible workarounds I wonder if I have to switch to another test runner. However Stencil is closely tied to jest.

Would appreciate any help here!

Findings that make me believe that jest maintainers are not too keen on making sym links work better:
jestjs/jest#1477

Things I have tried:

Expected behavior:
Tests run fine.

Related code:
Repo that re-produces the error scenario: https://github.com/bitflower/stencil-lerna-tests

@ionitron-bot ionitron-bot bot added the triage label Feb 26, 2020
@bitflower
Copy link
Contributor Author

Tried -22 quickly, unfortunately not solved:

image

@bitflower
Copy link
Contributor Author

Ok, updated the repo to use latest 1.9.1 and --next.

@bitflower
Copy link
Contributor Author

bitflower commented Mar 11, 2020

Also added a branch which directly calls jest as discussed in the contributors chat. It can be found here:
https://github.com/bitflower/stencil-lerna-tests/tree/jest-directly

It returns the same error:
image

@bitflower
Copy link
Contributor Author

Just tried this again with Stencil 2.0.3 but it's still uncapable of resolving lerna sym linked packages in my components.

@bitflower bitflower changed the title [1.9.0-19] jest can't resolve lerna dependencies (sym links) [2.0.3] jest can't resolve lerna dependencies (sym links) Sep 5, 2020
@bitflower
Copy link
Contributor Author

@rwaskiewicz @splitinfinities Hey guys! This is still a thing in the recent version 2.6.0. Any chance this can be looked at anytime soon? Let me know if I can provide anything more then the above repo. Thanks!

https://github.com/bitflower/stencil-lerna-tests

image

@bitflower
Copy link
Contributor Author

bitflower commented Jul 20, 2021

Good news: I've fixed the issue with jest not being able to resolve the symlinked lerna packages.

Commit: bitflower/stencil-lerna-tests@56e3b49

Still open: transform of imported sub-packages:

image

Explanation: pkg2 imports pkg1

@bitflower bitflower changed the title [2.0.3] jest can't resolve lerna dependencies (sym links) [2.6.0] jest can't resolve lerna dependencies (sym links) Jul 20, 2021
@splitinfinities
Copy link
Contributor

Duplicate of #2648

If you can share all their learnings in that issue, I would appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants