ruby-on-rails-5 - 如何在 react-rails 中调试 ExecJS 错误
问题描述
我正进入(状态;
Encountered error "#<ExecJS::ProgramError: Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.>
我只有在切换到 时才得到它,prerender:true
在此之前我没有收到任何与导入相关的错误。
我怎么能调试这个?问题的原因可能是什么?
引发错误的组件如下所示:
import React from "react";
import { configureStore } from "@reduxjs/toolkit";
import { Provider } from 'react-redux'
import {
myReducer,
} from "./redux/reducers/reducers";
import Main from "./Main";
const store = configureStore({
reducer: {
myReducer: myReducer,
},
});
function App(props) {
return (
<Provider store={store}>
<Main current_user={props.current_user}></Main>
</Provider>
);
}
export default App;
解决方案
推荐阅读
- bash - 仅针对子目录中的现有目录批量删除 (rm -rf)
- java - java - 如何从Java Spring Boot中的请求标头获取不记名令牌?
- c# - 如何通过单击按钮打开“openFileDialog”?
- flutter - 如何在小部件构建颤振之前加载/填充对象?
- string - 使用 '%v' 漂亮地打印未导出的字段
- angular - 如何知道用户是否在 Angular 中使用 beforeunload 留在页面中?
- octave - 当我点击选项卡并显示他们的帮助文本时,如何让 Octave 建议我班级的方法?
- kotlin - Kotlin 可以在 if 语句中声明变量吗?
- sql - SUM 中围绕 BIGINT 的 SQL 语法
- c++ - 向量的元素不更新