我有两个奇怪的错误;两个不同版本的awesome-typescript-loader会在一个操作系统(Ubuntu)上抛出错误,而在另一个操作系统(OSX)和vica verca上抛出错误 - 如果我升级的话。
案例1:
"awesome-typescript-loader": "3.1.0",
在OSX上,它会抛出此错误:
[at-loader] Checking finished with 1 errors
[at-loader]: Child process failed to process the request: TypeError: Cannot read property '0' of undefined
然后我们认为:好的,让我们升级到:
"awesome-typescript-loader": "3.1.3",
它适用于OSX!除此之外,我们以Jenkins(Ubuntu)为基础......虽然Jenkins对3.1.0版本很满意并且构建没有问题,但升级到3.1.3会引发以下情况:
[at-loader] Checking finished with 2 errors
Error in bail mode: [at-loader] ./src/pages/somePage.tsx:4:23
TS2307: Cannot find module 'History'.
..这与React和React-router有关,我想?但为什么这个模块具体呢?
换句话说,我们处于无法在本地构建没有错误的位置,或者无法在没有错误的构建服务器上构建。
可能是什么问题?是React-router-dom吗?
这是一个package.json样本:
"dependencies": {
"@types/history": "4.6.0",
"@types/react": "16.0.10",
"@types/react-dom": "16.0.1",
"@types/react-redux": "5.0.10",
"@types/react-router-dom": "4.0.8",
"@types/react-router-redux": "5.0.8",
"@types/react-tap-event-plugin": "0.0.30",
"history": "4.7.2",
"react": "16.0.0",
"react-dom": "16.0.0",
"react-redux": "5.0.6",
"react-router-dom": "4.2.2",
"react-router-redux": "4.0.8",
"react-tap-event-plugin": "3.0.2",
"redux": "3.7.2",
"redux-thunk": "2.2.0",
},
"devDependencies": {
"awesome-typescript-loader": "3.1.0", // Or 3.1.3 as mentioned
"connect-history-api-fallback": "1.3.0",
"cross-env": "5.0.5",
"express": "4.15.4",
"extract-text-webpack-plugin": "3.0.0",
"html-webpack-plugin": "2.30.1",
"http-proxy-middleware": "0.17.4",
"https": "1.0.0",
"react-hot-loader": "3.0.0-beta.7",
"redux-devtools": "3.4.0",
"source-map-loader": "0.2.1",
"tslint": "5.7.0",
"tslint-loader": "3.5.3",
"tslint-react": "3.2.0",
"typescript": "2.5.2",
"url-loader": "0.5.9",
"webpack": "3.5.5",
"webpack-dev-middleware": "1.12.0",
"webpack-hot-middleware": "2.18.2"
}