Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

283
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda