feathers icon indicating copy to clipboard operation
feathers copied to clipboard

authenticationClient - Not callable compilation error when using TS module Nodenext

Open elvince opened this issue 1 year ago • 2 comments

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,

elvince avatar Nov 20 '23 14:11 elvince

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

daffl avatar Nov 27 '23 19:11 daffl

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?

elvince avatar Nov 28 '23 09:11 elvince