Skip to content
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 fails intermittently when npm package main entry is set to "./" #5967

Closed
mtlewis opened this issue Apr 11, 2018 · 3 comments · Fixed by #5968
Closed

Jest resolver fails intermittently when npm package main entry is set to "./" #5967

mtlewis opened this issue Apr 11, 2018 · 3 comments · Fixed by #5968

Comments

@mtlewis
Copy link
Contributor

mtlewis commented Apr 11, 2018

The issue described in #5088 has been fixed by #5344 for main entries set to ".", but it looks like this issue can still occur when the main entry is set to "./".

PR incoming for this issue. - #5968

@mtlewis
Copy link
Contributor Author

mtlewis commented Apr 11, 2018

Note that it appears to be possible to work around the issue by creating a virtual mock to skip resolution for the module entirely:

jest.mock('co-request', () => jest.fn(), { virtual: true });

@ljharb
Copy link
Contributor

ljharb commented Apr 11, 2018

webpack has this same bug and it's very frustrating; it'd be nice if jest were to fix it.

mtlewis added a commit to mtlewis/jest that referenced this issue Apr 11, 2018
mtlewis added a commit to mtlewis/jest that referenced this issue Apr 11, 2018
cpojer pushed a commit that referenced this issue Apr 12, 2018
* Generalise package main resolving issue

Resolves #5967

* Update changelog with info about #5968

* Fix linting errors
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants