Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

271
Views
Program that works on Codepen.io couldn't run on Visual studio code

I completed a mini connect-4 game based on the Tic-tac-toe tutorial on Reactjs official website Code:https://codepen.io/bunansia/pen/KKXXKje?editors=1010 I copied the html,css plus JS file and tried to run on VCS but failed I have installed node.js, @babel/cli @babel/core @babel/preset-env @babel/preset-react have been installed, and this is how my package.json file looks like

{
  "name": "react-connect4",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "build": "babel src/index.js --out-file public/scripts/index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@babel/cli": "^7.16.0",
    "@babel/core": "^7.16.5",
    "@babel/preset-env": "^7.16.5",
    "@babel/preset-react": "^7.16.5"
  },
  "devDependencies": {
    "@babel/plugin-transform-react-jsx": "^7.16.5"
  },
  "description": "",
  "plugins": [
    [
      "@babel/plugin-transform-react-jsx",
      {
        "throwIfNamespace": false, // defaults to true
        "runtime": "automatic", // defaults to classic
        "importSource": "custom-jsx-library" // defaults to react
      }
    ]
  ]
}

I have also created .babelrc file instructing where to find the preset

{
    "presets": ["@babel/preset-env","@babel/preset-react"]
}

Have tried multiple ways like converting original JS file to babel version

"scripts": {
    "build": "babel src/index.js --out-file public/scripts/index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  }

And I put them in the folder named "public", while js && css files are in the folder named "script" But when I run it on live-server everything is blank What can be the configuration issues?

I have added 2 lines in html file since I am using these two external scripts also

<script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/react@17.0.2/umd/react.development.js"></script>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!