rwieruch / minimal-react-webpack-babel-setup

The minimal React, Webpack, Babel Setup. You want to get beyond create-react-app?

Home Page:https://www.robinwieruch.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting an error while using it in codesandbox.io

murtraja opened this issue · comments

I was trying out this setup with codesanbox.io but it throws an error. Do you have any ideas why this might be the case?

Thanks

P.S. the error is:

Invariant Violation
Target container is not a DOM element.
▶ 3 stack frames were collapsed.
evaluate
/src/index.js:6

  3 | 
  4 | const title = 'My Minimal React Webpack Babel Setup';
  5 | 
> 6 | ReactDOM.render(
  7 |   <div>{title}</div>,
  8 |   document.getElementById('app')
  9 | );

Checkout the id attribute in your .html file. Maybe it's not app, but root or something else: <div id="root" />

Thanks for the quick reply. When I searched for this error, the top answer was indeed the name conflict. But unfortunately, that doesn't seem to be the case :(

P.S. If you click on the link in my previous comment, it will take you directly to the code as well as the error

It turns out that webpack can't be configured with codesandbox.
Thanks for looking into this.
Closing the issue.