feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
14.97k stars 744 forks source link

authenticationClient - Not callable compilation error when using TS module Nodenext #3343

Open elvince opened 7 months ago

elvince commented 7 months ago

Steps to reproduce

Set module as NodeNext

in client.ts: import authenticationClient from '@feathersjs/authentication-client';

client.configure(authenticationClient());

Expected behavior

no error

Actual behavior

Type 'typeof import("xxx/node_modules/@feathersjs/authentication-client/lib/index")' has no call signatures.

Module versions (especially the part that's not working):

NodeJS version: 20.9

Operating System: W10

Module Loader: 5.0.11

Thanks,

daffl commented 7 months ago

Does import { default as authenticationClient } from '@feathersjs/authentication-client' work?

elvince commented 7 months ago

no this doesn't work. The only thing that works is this ugly fix:

import authenticationClientModule from '@feathersjs/authentication-client';
  const authenticationClient =
    authenticationClientModule as unknown as typeof authenticationClientModule.default;

Is there a way to fix on your side the typings so it works without hack?