Replies: 3 comments
-
I am facing the same issue? |
Beta Was this translation helpful? Give feedback.
0 replies
-
The error message is correct - it is not valid in Node.js either: ❯ node req.mjs
file:///Users/jarred/Desktop/req.mjs:1
import { Request } from "express";
^^^^^^^
SyntaxError: Named export 'Request' not found. The requested module 'express' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'express';
const { Request } = pkg; Is import { type Request } from "express"; |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks @Jarred-Sumner, importing as a type did work, but just curious why did it work in node, something i was doing in my node project, was it something that that ts-node took care of? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am building an express api with bun, i am getting following error on the following import
import { Request } from "express";
SyntaxError: Import named 'Request' not found in module '/Users/abcd/ccc/test-project/node_modules/express/index.js'. at processTicksAndRejections (:61:76) 56 | } 57 | } 58 | return new FixedQueue; 59 | }(); 60 | 61 | function processTicksAndRejections() {
Beta Was this translation helpful? Give feedback.
All reactions