gaearon/react-hot-loader
在 GitHub 查看npm test gives error - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
Open
#1,053 创建于 2018年8月25日
help wanted
描述
Description
Including react-hot-loader to create-react-app without ejecting - Followed this guide to implement
After running npm test (which runs the default test of create-react-app) getting the below
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
This github issue page - talks about - "The issue is not actually caused by react-app-rewired, but due to a problem with the mismatch in versions between jest-cli and babel-jest." - But I understand if using CRA, I can not update Jest manually.
Have also gone throught this stackOverflow question question and did npm install jest@latest --save-dev - But that didn't help.
What you are reporting:
bug
Environment
After running npm ls jest-environment-node
`-- react-scripts@1.1.5
`-- jest@20.0.4
`-- jest-cli@20.0.4
`-- jest-config@20.0.4
`-- jest-environment-node@20.0.3
my package.json
{
"name": "redux-boilerplate-base-counter-without-ejecting",
"version": "0.1.0",
"private": true,
"dependencies": {
"babel-jest": "^23.4.2",
"enzyme": "^3.5.0",
"enzyme-adapter-react-16": "^1.3.0",
"node-sass-chokidar": "^1.3.3",
"react": "^16.4.2",
"react-app-rewire-hot-loader": "^1.0.1",
"react-app-rewired": "^1.5.2",
"react-dom": "^16.4.2",
"react-hot-loader": "^4.3.5",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.5",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"test": "^0.6.0"
},
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom",
"eject": "react-scripts eject"
}
}
Run these commands in the project folder and fill in their results:
node -v: v10.1.0npm -v: 5.6.0
Then, specify:
- Operating system: Ubuntu 16:04
- Browser and version: Chrome Version 68.0.3440.106 (Official Build) (64-bit)