Jest: Error: Cannot find module './package' from 'index.js

Created on 4 Aug 2016  路  5Comments  路  Source: facebook/jest

I'm trying to use Jest to test some of my async NodeJs code. And I'm getting this error while trying to import one of my files.
It gets triggered from lib/commonjs/jest-resolve/build/index.js:197:17

Most helpful comment

Fixed the issue. Had to include this in my config:
jest": {
"moduleFileExtensions": [
"json"
]
}

I'm running into another issue now :) Will create a new thread for it.

All 5 comments

Can you provide a repository on github that I can npm install and npm test to locate the issue?

Unfortunately, I cannot share the repo since its Proprietary Information.

Would a stack trace be any useful?

Can you provide a reduced test case with just the modules required that point out this bug?

Fixed the issue. Had to include this in my config:
jest": {
"moduleFileExtensions": [
"json"
]
}

I'm running into another issue now :) Will create a new thread for it.

Was this page helpful?
0 / 5 - 0 ratings