0

I've read all the previous posts like this, none of which answered my question. I work on a small app for practice purpose, I run it with a simple task runner, no webpack. I get the above error in the console. he terminal says that the file compiles successfully. My package.json scripts looks like this:

{
  "name": "freecode",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "run-p start:* ",
    "start:react": "react-scripts start",
    "start-silent": "run-p start > /dev/null",
    "start-and-test": "run-p start-silent test ",
    "start-and-watch": "run-p start watch ",
    "watch": "run-p watch:* ",
    "watch:format": "onchange 'src/**/*.js' -- prettier --write {{changed}}",
    "refactor": "run-s refactor:*",
    "refactor:format": "prettier --write \"src/**/*.{js,html,scss}\"",
    "refactor:lint": "eslint src/",
    "build": "react-scripts build",
    "test": "react-scripts test --noStackTrace",
    "test-all": "react-scripts test --watchAll=false --noStackTrace",
    "test-related": "react-scripts test --watchAll=false --noStackTrace --findRelatedTests",
    "eject": "react-scripts eject"
  },

My index.html is:

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <div id="root"></div>
        <script type="text/javascript" src="index.js"></script>
    </body>
</html>

the index.js file looks like that:

import React from "react";
import ReactDOM from "react-dom";

import App from "./App";


ReactDOM.render (<App />, document.getElementById ("root"))

I don't think the problem is within the paths. Please help.

present_perfect
  • 149
  • 1
  • 2
  • 10

0 Answers0