Fork me on GitHub
#shadow-cljs
<
2023-05-30
>
Aviv08:05:52

Hey everyone, I’m trying to use ApolloClient (core), and it seems that shadow having some issues loading this module: ["@apollo/client/core" :refer [ApolloClient]] Any idea why or what can I do? Thanks 🙏

thheller11:05:02

the package seems to be doing something weird. I don't quite understand what that is but it has a special __DEV__ variable it expects somehow. might work if you :prepend-js "var __DEV__ = false;" in your build main module. so :modules {:main {:prepend-js ...}}. might not be named :main in your build, name doesn't matter

🙏 2
Aviv13:05:10

thanks, I just tried it, and it doesn’t seem to solve the issue

thheller14:05:23

may window.__DEV__ instead of var __DEV__?

Aviv14:05:32

this doesn’t work as well, is that the syntax:

:builds {:app {:prepend-js "window.__DEV__ = false;"}}

Aviv14:05:47

i just found another version of the apollo/client package that working without setting some prepend-js or anything else