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

modulePathsIgnorePatterns not being obeyed #10104

Closed
special-character opened this issue May 29, 2020 · 2 comments
Closed

modulePathsIgnorePatterns not being obeyed #10104

special-character opened this issue May 29, 2020 · 2 comments

Comments

@special-character
Copy link

special-character commented May 29, 2020

🐛 Bug Report

modulePathIgnorePatterns is not being applied from my config. I am getting the following error in react-native:

jest-haste-map: Haste module naming collision: react-native
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/../shared/package.json
    * <rootDir>/../.nexus/build/shared/package.json

This is happening because I ran a build locally of my nexus server that uses the shared module. Even after adding many combinations of modulePathIgnorePatterns the error still persists. Here is the jest config with the things that I have tried.

module.exports = {
  preset: 'jest-expo',
  modulePaths: ['.'],
  modulePathIgnorePatterns: [
    '<rootDir>/../.nexus/build',
    '<rootDir>/../',
    '<rootDir>/../.nexus/build/shared/package.json',
    '<rootDir>/../.nexus/build/shared',
    '.nexus/**.*',
  ],
  transform: {
    '^.+\\.(js|ts|tsx)$': require.resolve('react-native/jest/preprocessor.js'),
  },
}

To Reproduce

Not sure how to do this yet. We use yarn workspaces with these packages.

Expected behavior

I would not see the error

envinfo

  System:
    OS: macOS 10.15.4
    CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  Binaries:
    Node: 12.13.0 - /usr/local/bin/node
    Yarn: 1.22.4 - ~/workspace/calm/node_modules/.bin/yarn
    npm: 6.12.0 - /usr/local/bin/npm
  npmPackages:
    jest: ^25.3.0 => 25.5.4 
@john-ambrook
Copy link

Chiming in to say that I'm seeing the same issue:

jest-haste-map: Haste module naming collision: ...
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/package.json
    * <rootDir>/build/package.json

I've also tried mucking around with modulePathIgnorePatterns.

System info:

  System:
    OS: macOS 11.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 14.17.5 - ~/.nvm/versions/node/v14.17.5/bin/node
    Yarn: 1.22.11 - ~/.nvm/versions/node/v14.17.5/bin/yarn
    npm: 7.20.6 - ~/.nvm/versions/node/v14.17.5/bin/npm
  npmPackages:
    jest: ^25.5.4 => 25.5.4

@special-character special-character closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 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 Oct 31, 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