jest-haste-map: @providesModule naming collision warnings in docker

Created on 9 Feb 2018  路  4Comments  路  Source: facebook/jest

I might have found a bug issue with running jest iside node:alpine container

What is the current behavior?

docker run -it node:alpine /bin/sh

yarn add jest

jest

there are messages with @providesModule naming collision for all packages
```
This warning is caused by a @providesModule declaration with the same name across two different files.
jest-haste-map: @providesModule naming collision:
Duplicate module name: har-schema
Paths: /usr/local/share/.cache/yarn/v1/npm-har-schema-2.0.0-a94c2224ebcac04782a0d9035521f24735b7ec92/package.json collides with /usr/local/share/.cache/yarn/v1/npm-har-schema-1.0.5-d263135f43307c02c602afc8fe95970c0151369e/package.json
...
This warning is caused by a @providesModule declaration with the same name across two different files.
No tests found
In /
6609 files checked.
testMatch: /__tests__//.js?(x),/?(.)(spec|test).js?(x) - 27 matches
testPathIgnorePatterns: /node_modules/ - 6609 matches
Pattern: - 0 matches
error Command failed with exit code 1.
````

What is the expected behavior?

In docker jest should work like on the host OS (OSX) where it works without errors.

Docker for mac: Version 17.12.0-ce-mac49 (21995)

Most helpful comment

@vire I am having same issue with jest on bamboo. I dont really understand Well it's not a bug it's because the rootDir is / in the container means, would you elaborate on the actual fix the replacing something that actually fixed it? thanks

All 4 comments

When running with some tests I've also get an error for jest-haste-map

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (/node_modules/jest-haste-map/build/worker.js:44:29)
    at Generator.next (<anonymous>)
    at step (/node_modules/jest-haste-map/build/worker.js:63:1189)
    at /node_modules/jest-haste-map/build/worker.js:63:1419
    at Promise (<anonymous>)
    at Object.<anonymous> (/node_modules/jest-haste-map/build/worker.js:63:1100)
    at Object.worker (/node_modules/jest-haste-map/build/worker.js:63:46)
    at execMethod (/node_modules/jest-worker/build/child.js:92:29)
    at process.on (/node_modules/jest-worker/build/child.js:42:7)

Well it's not a bug it's because the rootDir is / in the container

@vire I am having same issue with jest on bamboo. I dont really understand Well it's not a bug it's because the rootDir is / in the container means, would you elaborate on the actual fix the replacing something that actually fixed it? thanks

Great response...

Was this page helpful?
0 / 5 - 0 ratings