React vitejs Unexpected string
Asked Answered
W

2

6

I was installing the @apollo/client library in my vite project and when i called

new InMemoryCache() from the apollo library i got console error Uncaught SyntaxError: Unexpected string

And if i clicked on the file where the error comed from (apollo dependency) this wa the red underlined line ((_globalThis$process = globalThis.process) === null || _globalThis$process === void 0 ? void 0 : _globalThis$"development") === "production" ? function instanceOf2(value, constructor) { return value instanceof constructor;

I tried so many things, using different cache libraries, changing vite condig js but I couldn't find the solution

Wingo answered 21/6, 2023 at 21:56 Comment(0)
Q
2

This could be an error introduced with version 16.7.0 of the graphql package. Please downgrade for 16.6.0 for now, we are looking into this.


Edit: this should be fixed with 16.7.1 now.

Quietly answered 22/6, 2023 at 8:23 Comment(7)
Is there any way you could share your project to help us debug this?Quietly
This seems like it is not a problem with the package itself - do you have any additional bundle config in place?Quietly
I just want to confirm that downgrading graphql to 16.6.0 fixed the issue. I received this error: code Uncaught SyntaxError: Unexpected string (at chunk-SALCFXIS.js?v=2629e44a:937:113) After I downgraded, the error went away.Tetracaine
By now, also 16.7.1 has been released which should fix the problem.Quietly
@Quietly I am getting this error with 16.8.0, 16.6.0 works for meEdgardo
It appears the error was not fixed in 16.7.1, it is still occurring in 16.8.1.Germinative
github.com/graphql/graphql-js/issues/3918Polis
I
3

i got that error also in 16.7.1.

node --version v18.16.1 npm --version 9.5.1

Only thing that works right now is to downgrade to 16.6.0 like Mark Kurkowski said!

Illustrate answered 11/7, 2023 at 9:41 Comment(0)
Q
2

This could be an error introduced with version 16.7.0 of the graphql package. Please downgrade for 16.6.0 for now, we are looking into this.


Edit: this should be fixed with 16.7.1 now.

Quietly answered 22/6, 2023 at 8:23 Comment(7)
Is there any way you could share your project to help us debug this?Quietly
This seems like it is not a problem with the package itself - do you have any additional bundle config in place?Quietly
I just want to confirm that downgrading graphql to 16.6.0 fixed the issue. I received this error: code Uncaught SyntaxError: Unexpected string (at chunk-SALCFXIS.js?v=2629e44a:937:113) After I downgraded, the error went away.Tetracaine
By now, also 16.7.1 has been released which should fix the problem.Quietly
@Quietly I am getting this error with 16.8.0, 16.6.0 works for meEdgardo
It appears the error was not fixed in 16.7.1, it is still occurring in 16.8.1.Germinative
github.com/graphql/graphql-js/issues/3918Polis

© 2022 - 2024 — McMap. All rights reserved.