我正在尝试通过create-react-app项目进行构建,但出现此错误,我不知道它在开发"react-scripts": "3.1.1",
中是否正常工作
Creating an optimized production build...
Failed to compile.
Cannot read property 'type' of undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
经过一番谷歌搜索后,我发现了与thunk有关的问题
https://github.com/reduxjs/redux-thunk/issues/29
我的代码看起来像这样
const axiosInstance = axios.create({
baseURL:CONFIG.HOST,
withCredentials: true
});
const store = createStore(reducers, applyMiddleware(reduxThunk.withExtraArgument(axiosInstance)));
但是我不知道发生了什么
答案 0 :(得分:1)
经过大量调试,我发现在编写scss代码时出错了
从//语法错误的scss更改
transform: rotate3d(1deg);
到
transform: rotate3d(0,0,0,1deg);
这个导致整个构建失败的简单错误