Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app.default is not a function #15

Open
rootlinux2 opened this issue May 15, 2021 · 0 comments
Open

app.default is not a function #15

rootlinux2 opened this issue May 15, 2021 · 0 comments

Comments

@rootlinux2
Copy link

I'm facing this error, I have the same webpack config as in your readme file.

 Error: HtmlWebpackPrerenderPlugin ERROR: Error rendering component.
  TypeError: app.default is not a function

My index.js

import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOMServer from 'react-dom/server';
import MyComponent from '../../pages/index';

const App = () => <h1>Hello world!</h1>;

if (document.body) {
  const div = document.getElementById('root');
  if (div.hasChildNodes()) {
    ReactDOM.hydrate(<MyComponent />, div);
  } else {
    ReactDOM.render(<MyComponent />, div);
  }
}

export default () => ReactDOMServer.renderToString(<App />);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant