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

183
Views
Mecanografiado cómo importar y exportar

Aquí está la línea de script en html

 <script src="a.js"></script>

También he intentado configurar type="module"

a.ts

 import {hello} from "./b" console.log(hello);

b.ts

 export let hello: string = "bob";

También probé un montón de opciones diferentes en mi archivo tsconfig, como cambiar el módulo a la opción de todo lo posible, así como el objetivo.

No se registra nada en la consola, a veces hay errores como que las exportaciones no están definidas o la definición no está definida o, a veces, no hay errores, pero no se muestra nada.

Por favor ayuda.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

La solución parece ser bastante simple. Agregue .js al final de la línea de importación

 import {hello} from "./b.js"

y debería funcionar bien. Tal vez el problema era que JS no sabía qué archivo debía importarse.

about 4 years ago · Juan Pablo Isaza Report
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!