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

[Bug]: Module not found using Jest but working without #12225

Closed
BenjD90 opened this issue Jan 7, 2022 · 4 comments
Closed

[Bug]: Module not found using Jest but working without #12225

BenjD90 opened this issue Jan 7, 2022 · 4 comments

Comments

@BenjD90
Copy link

BenjD90 commented Jan 7, 2022

Version

27.4.7

Steps to reproduce

Hello,

To reproduce the bug, simply try to import the module "eslint/use-at-your-own-risk" in a jest test, directly or indirectly.

Here a reproduction with very little (less than 10) lines of codes : https://replit.com/@BenjaminDaniel1/Eslint-use-eslintuse-at-your-own-risk-builtinRules?v=1

Thank you for your ideas to fix this,
Benjamin

Expected behavior

The module is well imported, using require.

Actual behavior

Module is "not found" when imported in a test.

Additional context

I'm using it in case of EsLint shared configuration testing.

Environment

System:
    OS: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (16) x64 Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz
  Binaries:
    Node: 14.18.2 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/bin/yarn
    npm: 6.14.15 - /usr/local/bin/npm
@nicolo-ribaudo
Copy link
Contributor

It's because Jest does not supports package exports yet. See #9771.

@SimenB
Copy link
Member

SimenB commented Jan 12, 2022

Yeah, I think #11961 would fix this (which will be part of Jest v28). I'll try to verify when that (or something like it) lands.

But generally, #9771 is the thing that needs to be resolved 👍

@SimenB
Copy link
Member

SimenB commented Feb 10, 2022

Yeah, tracked in #9771

@SimenB SimenB closed this as completed Feb 10, 2022
@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 Mar 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants