-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest-resolver unable to resolve relative require in dependency #7570
Comments
I narrowed this down a bit: |
The issue is that it's not If I upgrade your repo to Jest 24, the error becomes clearer:
Adding However, I don't like that the error says "from index.js" - that's really hard to find. We should include the actual |
Thanks for taking the time to reply and explain the issue. I didn't notice it ended in .json |
What is the solution for this issue? |
As per the updated error message, I updated my jest.config.js file to have the following:
|
Improving the error a bit more here: #8704 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
When jest-resolver attempts to load a dependency that uses a relative 'require', it fails to resolve.
Here is the code in ./node_modules/discord.js/index.js :
package.js exists at ./node_modules/discord.js/package.js
To Reproduce
Steps to reproduce the behavior:
Expected behavior
This is the expected error message:
Link to repl or repo (highly encouraged)
https://github.com/robertsmieja/jest-resolver-relative-import
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: