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

286
Vistas
TypeError: Cannot read properties of undefined (reading 'prototype') React Typescript + Express

I'm trying to use express at my React-Typescript SPA. But It's giving me the error:

    TypeError: Cannot read properties of undefined (reading 'prototype')
(anonymous function)
node_modules/express/lib/response.js:42
  39 |  * @public
  40 |  */
  41 | 
> 42 | var res = Object.create(http.ServerResponse.prototype)
  43 | 
  44 | /**
  45 |  * Module exports.

I've tried adding target: "node" to my "node_modules/react-scripts/config/webpack.config.js" But it won't work...

Here's some ways I've already tried to solve it:

    import express from "express";
    app = express();
---------------
    import express from "express";
    let app: express.Application;
    app = express();
-------------

    import express from "express";
    let app: any;
    app = express();

-------------
    const express require("express");
    let app: express.Application;
    app = express();
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You have to instantiate both the app and express, use the const keyword as well.

const express = require('express');
const app = express();

Also, look for anywhere in your code base where you have:

import { response } from 'express';

Often this is put in by mistake and removing this line may solve the error

about 4 years ago · Juan Pablo Isaza Denunciar

0

Faced same issue

it was imported under

import e from "express";

not sure cuz of any random IntelliSense extension or maybe the GH copilot auto-completion

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