Cannot find module 'store/actions/user' from 'login-form.js'
See original GitHub issuei have this jest configuration
"jest": {
"transform": {
"^.+\\.jsx?$": "babel-jest",
".*": "./tests/preprocessor.js"
},
"moduleFileExtensions": [
"js",
"jsx",
"json"
],
"setupFiles": [
"./tests/enzyme_setup"
],
"moduleDirectories": [
"node_modules",
"bower_components",
"shared"
]
}
and im using react redux and im getting this error
Test suite failed to run
Cannot find module 'store/actions/user' from 'login-form.js'
2 | import * as PropTypes from 'prop-types';
3 |
> 4 | import { userActionsShape } from 'store/actions/user';
5 | import Scss from './scss/index.scss'
6 |
7 | export class LoginFormComponent extends React.Component {
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:194:17)
at Object.<anonymous> (src/app/components/auth/login-form/login-form.js:4:13)
can someone please help me im stuck on this
thanks in advance carlos vieira
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Cannot find module 'store/actions/user' from 'login-form.js'
i already solved i put this config jest { "transform": { "^.+\\.js$": "babel-jest", "^.+\\.jsx$": "<rootDir>/__tests__/enzyme_setup.js", "^.
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
The module (package) not found is always specified in the format "Module not found: Error: Can't resolve 'package name' in 'project directory".
Read more >Fix a CloudWatch canary that's failing with the error "Cannot ...
The error message reads: Cannot find module ... under the nodejs/node_modules file path (such as nodejs/node_modules/myCanaryFilename.js).
Read more >I have an error it says: Error: Cannot find module '.env'
[nodemon] starting node ./index.js node:internal/modules/cjs/loader:936 throw err; ^ Error: Cannot find module '.env' Require stack: ...
Read more >Cannot find module 'lightning/flowSupport' from 'force-app ...
The lightning modules need to be mocked as jest doesn't have access to import modules like a lightning web component actually could.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need a
moduleNameMapper
to use absolute paths like'store/actions/user'
. See webpack guide on that: https://facebook.github.io/jest/docs/en/webpack.html#a-webpack-exampleThis 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.