-
Notifications
You must be signed in to change notification settings - Fork 454
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
[MODULE_NOT_FOUND] Error: ts-jest tried to access β¦, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. #1892
Comments
it looks to me like lodash ? |
My apologies! Forgot to include errors. I don't use lodash for this particular repo.
|
hmm looking at those dependencies, only a few eslint dependencies are used in the codebase. But those deps are devs and not used for production code. The rest of dependencies are not related to Not sure what yarn 2 is trying to do |
something similar is reported here yarnpkg/berry#1599 |
I also believe that error should originate from somewhere else. But I am having a hard time pinpointing the root cause. And the fact that For example, "devDependencies": {
"@types/jest": "^26.0.8",
"jest": "^26.2.2",
"jest-cli": "^26.4.2",
"ts-jest": "26.2.0",
"typescript": "^3.9.7"
}, generates error:
So in this case, adding |
in the reference link, you can see there is a comment also saying when running jest. I don't think in this case |
What about other cases, like these ones? Do you think they are also caused by
or
|
I suspect the |
What do you think about this?
Specifically, this line:
|
hmm that line is about reading I suspect the stacktrace is related to this https://github.com/kulshekhar/ts-jest/blob/master/src/util/get-package-version.ts#L6 |
I think webpack complains about this line, specifically method |
can you please try with this https://drive.google.com/file/d/1IzNZWnmuz4DblvadhMVpnZlQwWRwtc_W/view?usp=sharing ? |
How do I get it working? I tried installing dependencies but keep getting errors. Is it meant to be used as a patch? Or as standalone?
|
you can modify your project
then run |
I think it looks good now. I don't get no more |
yes I found that reading package.json to compute cache key isn't necessary so removing it also makes sense. I will use that as a fix for this issue. |
Thank you very much for being so pro-active and helping me with the issue! Greatly appreciated! π |
@ahnpnl do you know when next release will be available on npmjs? |
hi, somewhere this week :) |
AWesome, cheers! :) |
π Bug Report
When I add certain dependencies, I end up with a lot of errors like:
This could be related to #1857 but I am not sure though.
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/alexkuc/ts-jest-yarn-2-bug
yarn install
yarn test
Expected behavior
Error
[MODULE_NOT_FOUND]
should not appear.Link to repo (highly encouraged)
https://github.com/alexkuc/ts-jest-yarn-2-bug
Debug log:
envinfo
Edit: forgot to include errors
The text was updated successfully, but these errors were encountered: