-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Typescript compilation problems while upgrading pinecone client in angular project #105
Closed
2 tasks done
Labels
bug
Something isn't working
Comments
Sorry for the lousy upgrade experience. We have some other type-related issues we are investigating and we'll see what we can do to straighten this out soon. |
3 tasks
jhamon
added a commit
that referenced
this issue
Sep 14, 2023
## Problem Several users have reported issues with typescript compilation This PR addresses: - #102 - #105 ## Solution ### Clean up unused dependencies to resolve web-related type errors I started by deleting dependencies and running tests to see what dependencies were no longer in use. I was able to delete these: - @types/web - @jest/globals - unique-names-generator Removing `@types/web` seems to have resolved the majority of Typescript issues related to conflicts with web types in `lib.dom.d.ts`. Since I was already in there mucking with dependencies, I went ahead and shuffled a few things between dependencies/devDependencies just to align with my current understanding of things. ### TS1005 (Typescript versions <=4.4) People on older typescript versions report seeing many errors like this: ``` Error: ../pinecone-ts-client/dist/control/index.d.ts(1,31): error TS1005: ',' expected. ``` These errors were caused by using import statements that combined type and value imports onto one line. This syntax was evidently not supported in versions of typescript prior to 4.4. Resolving these issues involved refactoring about 30 import statements along these lines: ```diff -import { IndexNameSchema, type IndexName } from './types'; +import { IndexNameSchema } from './types'; +import type { IndexName } from './types'; ``` ### Typebox errors (Typescript >= 5.1) The `@sinclair/typebox` dependency is causing issues with very recent versions of typescript. ``` ../node_modules/@sinclair/typebox/typebox.d.ts:179:167 - error TS2589: Type instantiation is excessively deep and possibly infinite. 179 ] extends [TArray, TNumber] ? AssertType<T['items']> : K extends TTemplateLiteral ? TIndexReduce<T, TTemplateLiteralKeyRest<K>> : K extends TUnion<TLiteral<Key>[]> ? TIndexReduce<T, TUnionLiteralKeyRest<K>> : K extends TLiteral<Key> ? TIndexReduce<T, [K['const']]> : TNever; ``` ### New CI job: `typescript-compilation-tests` To verify this compilation issue doesn't come up again, I added a new github actions job along with a version matrix. It tests every major version of typescript back to version 4.1 (released [fall 2020](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/)) along with a version of pinecone, then checks whether it can successfully `tsc`. I ran these with the v1.0.0 pinecone release to see the jobs fail as reported, then updated it to install the latest code in this branch and saw them pass. This will be part of CI for every PR from now on. ## Type of Change - [x] Bug fix (non-breaking change which fixes an issue) - [x] This change requires a documentation update - [x] Infrastructure change (CI configs, etc) ## Test Plan Should see new compilation tests passing in CI. There are now 13 different checks running in CI to exercise compilation with major versions of TypeScript. ## Follow-up Probably we should add a lint rule to prevent us adding back any mixed type/value imports.
The |
jhamon
changed the title
[Bug] <title>problem after upgrading pinecone client to new version in angular project
[Bug] Typescript compilation problems while upgrading pinecone client in angular project
Sep 15, 2023
Hi,
I think it is working now, thanks.
MArcin
… Wiadomość napisana przez Jennifer Hamon ***@***.***> w dniu 15.09.2023, o godz. 00:56:
The 1.0.1 release is out and contains a bunch of fixes on the TypeScript front. Release notes here <https://github.com/pinecone-io/pinecone-ts-client/releases/tag/v1.0.1>. Please try it out and let me know if you're still having problems.
—
Reply to this email directly, view it on GitHub <#105 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQXVXLYE6HDGV6ZUDT6RQRDX2ODQJANCNFSM6AAAAAA4SICZUU>.
You are receiving this because you authored the thread.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this a new bug?
Current Behavior
I installed Pinecone in angular project in firebase functions with npm uninstall @pinecone-database/pinecone.
Previously it worked well, but after introducing version 1 of pinecone, I cannot deploy functions. I receive over 1000 bugs while deploying. Here is the summary of the message:
They disappear when I uninstall pinecone again, this is how I know that the problem is related to pinecone.
I even downgraded pinecone library to version 0.1.6 and it started working again.
Exapmple of bugs are:
I reinstalled pinecone several times and nothing worked. I also searched for answer on pinecone forum, but the problem didn't appear. I created totally new angular project, copied sources files and tried to launch functions from scratch, but it didn't help either.
Expected Behavior
To work well after installing new pinecone version for angular project firebase functions.
Steps To Reproduce
Relevant log output
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: