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

214
Vistas
Unable to transpile ES6 express server using Parceljs in development mode

I am trying to transpile an ES6 express app using Parceljs.

Trying to run the parcel dev server using yarn parcel index.js displays that it is running at localhost:1234 but the page is blank. It also generates the following output when trying to run node dist/index.js:

index.js:116
    throw error;
    ^

TypeError: Cannot read properties of undefined (reading 'prototype')

Running yarn parcel index.js --target node does not yield any localhost port for me to test the API with. However, the API now works as I can use node dist/index.js to run the script but now I have to resort to npx nodemon /dist/index.js to have file watching.

Here is the sample code. index.js

import express from "express";
const app = express();
const port = 5000;

app.get("/", (req, res) => {
  res.json({ msg: "Hello!" });
});

app.listen(port, () => {
  console.log(`Example app listening on port ${port}`);
});

package.json

...
  "dependencies": {
    "express": "^4.17.3",
    "parcel": "^2.3.2",
    "parcel-bundler": "^1.12.5"
  }
...

I would greatly appreciate a solution that allows me to use Parceljs to watch for file updates directly, preferably with HMR.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

See issue 355: Is parcel meant to work with server-side code insluding HMR?: parcel does not (yet) support hot module reloading in nodejs.

about 4 years ago · Juan Pablo Isaza Denunciar

0

parcel creates a web server and serve your code but express need to be called by itself to be able create a web server and server requests. You'd better use babel & nodemon instead of parcel

I use command bellow

nodemon --exec babel-node src/index.js

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