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

React JS Safiul Tarek

Problem: Trying to use express at my React-Typescript SPA. But It's giving me the error:

typeerror-cannot-read-properties-of-undefined-reading-prototype

Solution: We 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 code base where we have:

import { response } from 'express';

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

Thank you for reading the article. If you face any problem please comment below.