-
-
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
require traversing wrong directory to find package #609
Comments
Have you, during your project livetime, upgraded from npm2 to npm3? It seems that the dependency is installed twice. |
Yes, I was using npm2 before upgrading to npm3 but have definitely removed What makes you say |
This seems related to #554. Can you add react-overlays and react-prop-types to your unmocked module list in the config? |
@cpojer, it's not. No mocking happening at all for that test. Also tried adding the two packages to unmocked list. |
Oh I'm sorry, I see now what you mean. The problem is that two projects depend on the same dependency but different versions of it. npm3 installs one of them in @amasad does the new resolver fix this use-case? What does it give preference to? |
That's correct, @cpojer. I scoured the npm changelog and only found this but doubt it's related at all: npm/npm@a8c8a13 . What handles resolution by |
I think this won't be a problem with the new resolver from #599. I'll close it once this gets merged into jest at the beginning of December. |
@hgezim would you mind retrying with jest@next (0.9.0-fb1) and reporting whether it resolves your issue? |
Hi @cpojer, can't confirm if it's fixed. Getting an error for my use of JSX in the test file. Probably
|
That seems unrelated to the 0.9 update and is likely also happening on 0.8 then? You can also try --no-cache. |
Please let me know if this is still a problem with |
Fixed! Thanks so much! Sorry I couldn't test it earlier. |
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. |
Amongst other packages,
react-bootstrap
depends on:react-prop-types@0.3.0
react-overlays
which depends on:react-prop-types@0.2.2
npm 3
installsreact-prop-types
as follows:The problem rises in
node_modules/react-bootstrap/lib/ButtonGroup.js
where require is called as follows:Since
react-bootstrap
depends onreact-prop-types@0.3.0
, it should find./node_modules/react-prop-types
but instead it finds./node_modules/react-overlays/node_modules/react-prop-types
and then fails with:This fails when running tests with
jest
. It doesn't look like a mocking issue.To be clear, my project doesn't directly require
react-prop-types
:The text was updated successfully, but these errors were encountered: