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

370
Views
VSCODE: no se puede ejecutar ni siquiera el programa más básico con javascript

Después de mucho solucionar los problemas, decidí intentar que los programas más básicos se ejecutaran y no tuve mucha suerte. Aquí están mis pasos:

Instalé lit en el mismo directorio que mi index.html y app.js usando npm i lit . Generé mi package.json usando npm init y elegí los valores predeterminados.

Aquí está mi index.html :

 <!DOCTYPE html> <head> <script type="module" src="./app.js"></script> </head> <body> <test-element></test-element> </body> </html>

Aquí está mi app.js :

 import {html, css, LitElement} from 'lit'; export class Test extends LitElement { constructor() { super(); } render() { return html`<p>Test</p>`; } } customElements.define('test-element', Test);

Aquí está mi package.json :

 { "name": "test", "version": "1.0.0", "description": "", "main": "index.js", "type": "module", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "lit": "^2.2.3" } }

¿Qué estoy haciendo mal aquí?

EDITAR: No estoy seguro de por qué se cerró esto, pero el problema era que estaba usando la extensión integrada de Live Server en VS Code. Ejecutar un servidor web directamente con npm pareció solucionarlo. https://modern-web.dev/docs/dev-server/overview/

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!