-
Notifications
You must be signed in to change notification settings - Fork 460
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
TypeError: Unable to require .d.ts
file with yarn workspaces and TypeScript project references when using --no-cache
#1336
Comments
Hi, I can confirm that at the moment, We are lack of staffs to maintain or implement new features now so we would love to receive helps from community in implementing monorepo support for |
since use |
close in favor of #1343 |
There were issues related to the monorepo and ts-jest - kulshekhar/ts-jest#1336 when we had jest config in root.
* fix: Missing key prop * fix: Jest config to work with common-rendering * feat: Added KeyEvents to LiveLayout * chore: I ran prettier * feat: Removed superfluous caching Co-authored-by: Olly <olly.namey@theguardian.com> * fix: Formatting Co-authored-by: OllysCoding * fix: Add yarn command back in Co-authored by @OllysCoding * chore: Oh my God, how hard is this Co-Authored-By: Olly <9575458+OllysCoding@users.noreply.github.com> * fix: Skipping for now while we wait to fix jest config Co-Authored-By: Olly <9575458+OllysCoding@users.noreply.github.com> * fix: Added `preserveSymlinks` to jest config to workaround monorepo issues with jest kulshekhar/ts-jest#1336 (comment) * fix: Added `preserveSymLinks` to tsconfig.test kulshekhar/ts-jest#1336 (comment) * fix: Restore tests * fix: Restore previous config * refactor: Replace reduce with filter > map Co-authored-by: Olly <olly.namey@theguardian.com> Co-authored-by: Olly <9575458+OllysCoding@users.noreply.github.com>
Issue :
In a mono repository with yarn workspaces and TypeScript project references, ts-jest fails with the error
TypeError: Unable to require .d.ts file.
in a package/project/workspace that references another local package/project/workspace in case the jest cache is empty or tests are run with the--no-cache
option.There are two workarounds:
isolatedModules: true
injest.config.js
of the project that references the other onepreserveSymlinks: true
intsconfig.json
of the project that references the other oneExpected behavior :
ts-jest should run the tests without an error even if the workarounds are not used.
Debug log:
log file content
Minimal repo :
https://github.com/mfellner/ts-jest-issue-805-demo
Related issues
.d.ts
file on Unix only #1289The text was updated successfully, but these errors were encountered: