jordanbtucker
jordanbtucker
DDeno
Created by jordanbtucker on 6/14/2024 in #help
Default export has no call signatures
I'm trying to import the default export from npm:@feathersjs/express, but Deno complains that the default export has no call signatures.
// main.ts
import express from "npm:@feathersjs/express";
const app = express();
// main.ts
import express from "npm:@feathersjs/express";
const app = express();
$ deno check main.ts
error: TS2349 [ERROR]: This expression is not callable.
Type 'typeof import("file:///.../node_modules/.deno/@feathersjs+express@5.0.26/node_modules/@feathersjs/express/lib/index.d.ts")' has no call signatures.
const app = express();
~~~~~~~
$ deno check main.ts
error: TS2349 [ERROR]: This expression is not callable.
Type 'typeof import("file:///.../node_modules/.deno/@feathersjs+express@5.0.26/node_modules/@feathersjs/express/lib/index.d.ts")' has no call signatures.
const app = express();
~~~~~~~
However, running main.ts works without issue. The referenced index.d.ts contains this:
export default function feathersExpress<S = any, C = any>(feathersApp?: FeathersApplication<S, C>, expressApp?: Express): Application<S, C>;
export default function feathersExpress<S = any, C = any>(feathersApp?: FeathersApplication<S, C>, expressApp?: Express): Application<S, C>;
So Deno should see its default export. The strange thing is that the following works when checking the file and running it.
import express from "npm:@feathersjs/express";
const app = express.default();
// ^^^^^^^
import express from "npm:@feathersjs/express";
const app = express.default();
// ^^^^^^^
And the following check returns true:
console.log(express === express.default); // true
console.log(express === express.default); // true
So why doesn't Deno like it when I use express() instead of express.default()?
2 replies