I'm doing a react project for school and am getting the following error when trying to load the web server:
Error: Target container is not a DOM element. react-dom.development.js:26091
render React
js index.js:7
js main.chunk.js:566
Webpack 7
__webpack_require__
fn
1
__webpack_require__
checkDeferredModules
webpackJsonpCallback
<anonymous>
The index.js code looks like this:
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more:
reportWebVitals();
How can I solve this so I can start playing around with the look of the webpage?