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

235
Vistas
Is it possible to import JS code from a HTML file?

This is a continuation of my efforts to troubleshoot the problems shown here where I am trying to understand how to run a Node.js application which the author is saying that it can be run straight from the webserver (ES6 ?)

As you can see I am receiving some errors from my browser enter image description here

After diving into the sources of the app (which might be too much for my level) I am seeing this line
import editorTemplate from './templates/editorTemplate.html' and the file in question is indeed a text/html file and there is nothing to import from there The above strange (to me) import is attempted here https://github.com/SVG-Edit/svgedit/blob/master/src/editor/EditorStartup.js

Is this a mistake ?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The key problem is that you are attempting to load the raw src files. They are not runnable JS files. You will need to serve the bundled distribution files that were output by the project's build pipeline.

In particular, the project is using rollup, and has configured it to use the rollup-plugin-html. It will inline the html as a string in the script.

about 4 years ago · Santiago Trujillo Denunciar
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