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

429
Views
JS: SyntaxError no capturado: no se puede usar la declaración de importación fuera de un módulo

Estoy aprendiendo base de fuego. Estoy usando Kubuntu 21.04. Instalé nodejs y npm usando:
sudo apt install nodejs npm una carpeta de proyecto con el archivo index.html /home/username/project/index.html .
También instalé firebase usando npm install firebase mientras estaba en la carpeta del proyecto en la terminal.
Sigo hasta el PASO 2 como se indica en https://firebase.google.com/docs/web/setup .
Mi contenido index.html-

 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>User Auth</title> </head> <body> <h1>User Auth</h1> <script> // Import the functions you need from the SDKs you need import { initializeApp } from "firebase/app"; import { getAnalytics } from "firebase/analytics"; // TODO: Add SDKs for Firebase products that you want to use // https://firebase.google.com/docs/web/setup#available-libraries // Your web app's Firebase configuration // For Firebase JS SDK v7.20.0 and later, measurementId is optional const firebaseConfig = { apiKey: "AIzaSyC5zv8b1wfc0ykmpULeFI6tJa6Grk", authDomain: "user-auth-75223.firebaseapp.com", projectId: "user-auth-78563", storageBucket: "user-auth-78563.appspot.com", messagingSenderId: "482788408547", appId: "1:482788408547:web:89e3ecdc24f3454576c00aa", measurementId: "G-VK5D45CCJ2" }; // Initialize Firebase const app = initializeApp(firebaseConfig); const analytics = getAnalytics(app); </script> </body> </html>

Pero cuando ejecuto el archivo html anterior en Chrome. Está dando error en la consola de Chrome.

SyntaxError no capturado: no se puede usar la declaración de importación fuera de un módulo

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

0

¿Probablemente se deba a que no agregó "type":"module" en package.json?

Solucioné este problema agregando esta línea

fuente: (nodo: 9374) Advertencia: para cargar un módulo ES, establezca "tipo": "módulo"

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!