Skip to content
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

weaviate-ts-client library error on sveltekit #86

Closed
emilaleksanteri opened this issue Jul 26, 2023 · 3 comments
Closed

weaviate-ts-client library error on sveltekit #86

emilaleksanteri opened this issue Jul 26, 2023 · 3 comments

Comments

@emilaleksanteri
Copy link

Hi, I keep getting this error in the weavite-ts-client source:

"Uncaught (in promise) SyntaxError: missing name after . operator"

The view source points out to the line below FIX ME comment as the issue at weaviate-ts-client.js:2365:35

// node_modules/.pnpm/[email protected]/node_modules/graphql/jsutils/instanceOf.mjs var instanceOf = ( /* c8 ignore next 6 */ // FIXME: https://github.com/graphql/graphql-js/issues/2317 globalThis.process && globalThis."development" === "production" ? function instanceOf2(value, constructor) { return value instanceof constructor; } : function instanceOf3(value, constructor) { if (value instanceof constructor) { return true; } ...

I don't know if this is an issue in my end on the specific TS config in Sveltekit or if its in the source for certain since the library seems to work on just a vanilla ts-node set up while failing to work in the sveltekit environment.

@emilaleksanteri emilaleksanteri changed the title Uncaught (in promise) SyntaxError: missing name after . operator weaviate-ts-client library error on sveltekit Jul 27, 2023
@dirkkul dirkkul transferred this issue from weaviate/weaviate Aug 18, 2023
@tsmith023
Copy link
Contributor

Hi @emilaleksanteri, this looks like a weird one! Thank you for raising it 😁

Through doing some digging, I've come across this thread: mswjs/msw#1655, where they discuss how [email protected] introduces a bug that is relevant to the source that you posted. Their solution is to pin their graphql dependency to below 16.7.0.

I think the same problem that happened there is also affecting us. Our graphql dependency comes through graphql-request, which we depend on as ^5.1.0 thereby installing 5.2.0 in our released npm package. [email protected] depends on graphql as ^16.6.0 and so itself installs 16.7.1 in our released npm package. You then see erroring source code relevant to the [email protected] package in your node_modules folder.

We are in the process of releasing a new version of the TS client that is compatible with the most up-to-date Weaviate server that went live yesterday. I will ensure that this fix is included in that release!

@emilaleksanteri
Copy link
Author

@tsmith023 Thank you for the response, sounds exciting!!

@tsmith023
Copy link
Contributor

@emilaleksanteri, it turns out graphql have actually resolved this already: graphql/graphql-js#3923, so no changes need to be made on our side to deal with the breaking upstream problem. You just need to reinstall your dependencies by deleting node_modules and running npm install --force. Then [email protected] should be installed.

I will close this now as not planned since the upstream problem has in fact been addressed

😁

@tsmith023 tsmith023 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants