Finch-API / finch-api-node

Apache License 2.0
5 stars 1 forks source link

version 5.22.6 import Finch change #360

Closed Cam-Bread closed 5 months ago

Cam-Bread commented 5 months ago

It looks like in the latest version of @tryfinch/finch-api, (5.22.6) the default Finch export was removed. This means your readme instructions are incorrect:

import Finch from '@tryfinch/finch-api';

const finch = new Finch({
  accessToken: 'My Access Token',
});

this - any code written following it - will now trigger an error:

Type error: This expression is not constructable.
12:01:40.416 | Type 'typeof import("/vercel/path0/node_modules/.pnpm/@tryfinch+finch-api@5.22.6/node_modules/@tryfinch/finch-api/index")' has no construct signatures.

In my code I had to update the import as follows to resolve the error:

import {Finch} from "@tryfinch/finch-api";

easy fix but I am sure it will confuse people just setting things up if the readme instructions are incorrect.

RobertCraigie commented 5 months ago

Thanks for the report and sorry about this, we'll have a fix out shortly. https://github.com/Finch-API/finch-api-node/pull/361.

I'm also not sure why our tests didn't catch this, we'll investigate that as well.

RobertCraigie commented 5 months ago

This has been fixed in 5.22.7

Cam-Bread commented 5 months ago

That was quick! thanks :)