yarn 2 berry: tsdx tried to access babel-jest, but it isn't declared in its dependencies;
See original GitHub issueCurrent Behavior
when using v0.13.2 with yarn 2 berry, I get the following error when running tsdx test
Error: tsdx tried to access babel-jest, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Expected behavior
all modules that are references using require
or require.resolve
have to be part of the dependencies of the package.
Suggested solution(s)
add babel-jest
to the direct dependencies
Additional context
Your environment
Software | Version(s) |
---|---|
TSDX | 0.13.2 |
TypeScript | 3.8.3 |
Browser | n.a |
npm/Yarn | yarn 2 berry |
Node | 12.16.1 |
Operating System | win |
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
Migration | Yarn - Package Manager
A step-by-step and in-depth migration guide from Yarn 1 (Classic) to Yarn 2 (Berry).
Read more >A guide through The Wild Wild West of setting up a mono repo ...
In this part, I will explain step by step how to setup Lerna, Yarn Workspaces and Typescript in a mono repo. In the...
Read more >Problems with Intellisense with Yarn (berry) 2 PnP and ...
Questions in bold. Webstorm (tried 2020.2.2 and 2020.2.3RC) on Windows 10 x64 Webstorm should support Yarn 2 and PnP since 2019.3+ Is it......
Read more >Introducing Yarn 2 ! - DEV Community
If you just want to start right now with Yarn 2, check out the Getting ... to access // a package that is...
Read more >Getting Started - Jest
Note: Jest documentation uses yarn commands, but npm will also work. You can compare yarn and npm commands in the yarn docs, here....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In case this is helpful:
I think
module.createRequire()
is the correct approach when trying to load dependencies that you must assume are declared by a differentpackage.json
and not your own.https://nodejs.org/api/module.html#module_module_createrequire_filename
so far I was able to manage it to get it work together with yarn 2 in my monorepo: https://github.com/upsetjs/upsetjs. It required some customization (like the rollup-plugin-pnp-resolve for rollup: https://github.com/upsetjs/upsetjs/blob/master/packages/model/tsdx.config.js) but doable.