cereallarceny / cra-ssr

[DEPRECATED] Server-side rendering with create-react-app, React Router v4, Helmet, Redux, and Thunk
484 stars 118 forks source link

Application shows the error: Element type is invalid when in StrickMode #40

Open francisrod01 opened 6 years ago

francisrod01 commented 6 years ago

Application shows the error: Element type is invalid when in StrickMode


const { store, persistor } = configureStore();
//console.log(persistor);
//persistor.purge();
const history = store.getHistory();

registerAxiosInterceptors();

const Application = (
    <ReduxProvider store={store}>
        <PersistGate loading={null} persistor={persistor}>
            <Router history={history}>
                <Frontload noServerRender={true}>
                    <ThemeZero />
                </Frontload>
            </Router>
        </PersistGate>
    </ReduxProvider>
);

const root = document.querySelector('#root');

if (root.hasChildNodes() === true) {
    // If it's an SSR, we use hydrate to get fast page loads by just
    // attaching event listeners after the initial render.
    Loadable.preloadReady().then(() => {
      hydrate(Application, root);
    });
}
else {
    // If we're not running on the server, just render like normal
    render(Application, root);
}
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: symbol.
    at invariant (invariant.js:42)
    at createFiberFromElement (react-dom.development.js:5731)
    at reconcileSingleElement (react-dom.development.js:7532)
    at reconcileChildFibers (react-dom.development.js:7636)
    at reconcileChildrenAtExpirationTime (react-dom.development.js:7768)
    at reconcileChildren (react-dom.development.js:7751)
    at updateHostRoot (react-dom.development.js:7946)
    at beginWork (react-dom.development.js:8235)
    at performUnitOfWork (react-dom.development.js:10215)
    at workLoop (react-dom.development.js:10279)
cereallarceny commented 5 years ago

Can you be more specific @francisrod01 ?