Portkey-AI / portkey-node-sdk

Build reliable, secure, and production-ready AI apps easily.
https://portkey.ai/docs
22 stars 8 forks source link

Type Errors bubbling up to project #24

Closed HisWordLLC closed 9 months ago

HisWordLLC commented 9 months ago

https://github.com/Portkey-AI/portkey-node-sdk/blob/56d1911739a8201811b69bfad04d56728a281b9a/src/index.ts#L7

I don't know if others have experienced this, but I'm getting a Type Error bubbling up to the project level:

> tsc

node_modules/portkey-ai/dist/src/index.ts:7:1 - error TS1269: Cannot use 'export import' on a type or type-only namespace when 'isolatedModules' is enabled.

7 export import LLMOptions = Types.LLMOptions;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/portkey-ai/dist/src/index.ts:7

Will just ignore type checking in builds for now. Let me know if you want a PR to assist. 👍

dosubot[bot] commented 9 months ago

🤖

That's great to hear that you're willing to help out! Your contribution would be much appreciated. Feel free to submit a PR with your proposed fix whenever you're ready. Thank you for your willingness to assist with this issue!


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

Tim-Machine commented 9 months ago

I'm getting the same issue with using Next.js. Everything works fine until you run next build.

image

VisargD commented 9 months ago

Thanks for reporting this and also providing detailed errors. We will push a fix for this today

HisWordLLC commented 9 months ago

Thanks for the fast reply, @VisargD

Really enjoying the service so far. Have some small UI papercuts in the platform that I can submit if it helps. Let me know a good place to do so.

VisargD commented 9 months ago

That's so good to hear!! You can join our discord and report the UI feedback there. Here is our discord link: https://t.co/lZEFk6kbbb

VisargD commented 9 months ago

The ideal solution here would have been to change the re-export to support types in isolatedModules which would have made the export something like this (as mentioned here in TS docs):

export type { LLMOptions } from "./_types/portkeyConstructs";

But the LLMOptions interface itself is deprecated now and we do not support it anymore. So we will be removing the interface and export itself. I will be merging the PR for this very soon.

VisargD commented 9 months ago

This issue has been fixed in the latest release of the SDK. Please update version to 1.1.3 and try it out.

gdibble commented 9 months ago

@VisargD I noticed the churn/reversion and wanted to say thanks for your efforts!

I've run yarn upgrade portkey-ai@^1.1.3 and can confirm on my project that nextjs can [again/now] build. ✅

VisargD commented 9 months ago

That's great! Thanks for the confirmation.

VisargD commented 9 months ago

Closing this issue as it is resolved now. Feel free to create a new one if you have other queries. Thanks again for reporting and providing details.

HisWordLLC commented 9 months ago

Just updated and tested. All works great! Thanks for the quick solve. 😃