-
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
Yarn 2 and Plug'n'Play #1857
Comments
The easiest fix is move @types/jest to dependencies ? Or do you have any other suggestions ? |
I would say it is more of a workaround rather than fix as @types/jest is not needed to compile the source? Isn't typically deps are what is needed to compile the source and devdeps are purely tooling/development deps? |
In the documentation, it is specified explicitly that @types/jest needs to be installed together, seems like yarn 2 is not happy about that way. |
I think I misunderstood you. Installation was done as per manual, i.e. This is the {
"name": "test",
"version": "1.0.0",
"main": "index.js",
"author": "Alexander Kucheryuk <3331946+alexkuc@users.noreply.github.com>",
"license": "MIT",
"devDependencies": {
"@types/jest": "^26.0.8",
"jest": "^26.2.2",
"ts-jest": "^26.1.4",
"typescript": "^3.9.7"
},
"scripts": {
"test": "jest"
}
} |
ts-jest source shipped to npm doesn’t use @types/jest so I suspect only that tsconfig.build.json extends tsconfig.json and tsconfig.json includes @types/jest |
Does it mean that I need to change my repository config or is it something on the ts-jest end? |
Oh I don’t know yet, will need to test a few possible theories. One thing I am certain is codes shipped to npm doesn’t use @types/jest |
ok I found the issue here Line 13 in 1a44b70
Since this is a public API, the only way to fix the problem is adding |
Hmm maybe import type syntax can solve this ? Gonna try that Unfortunately, it doesn't work, so the only solution is moving |
Thank you! |
I have reverted #1859 and retested with latest yarn 2 and it seemed like Yarn 2 has improved so the warning [MODULE_NOT_FOUND] doesn't show anymore. |
🐛 Bug Report
When using Yarn 2 with Plug'n'Play feature, I get a number of errors like:
To Reproduce
Steps to reproduce the behavior:
https://github.com/alexkuc/ts-jest-yarn-2-bug
Expected behavior
Yarn error
[MODULE_NOT_FOUND]
should not occur.Link to repo (highly encouraged)
https://github.com/alexkuc/ts-jest-yarn-2-bug
Debug log:
envinfo
The text was updated successfully, but these errors were encountered: