-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
createUploadLink : TypeError: Object(...) is not a function #43
Comments
Are you using native ESM in node ( |
@jaydenseric no just a regular create-react-app setup |
Strange. Does it work if you try: import apolloUploadClient from "apollo-upload-client" And: const client = new ApolloClient({
link: apolloUploadClient.createUploadLink({ uri: "http://localhost:3002/graphql" }),
cache: new InMemoryCache(),
}) |
Neither. I got TypeError: __WEBPACK_IMPORTED_MODULE_6_apollo_upload_client___default.a.createUploadLink is not a function |
Oh, if it's create-react-app there is a bug that has been patched to do with webpack being misconfigured to treat .mjs files as assets instead of JS files. I'll dig up a link for you. |
See #35 (comment) 🙂 |
Thanks a lot |
Hi, i was reading up this thread and upon following it works. Now, when i push the code to a live link, the error gives : "Error! Network error: Unexpected token < in JSON at position 0" which is occurring due to this the createUploadLink function. This happens when i change "http://localhost:3000/graphql" to the live link of "http://my-website/graphql" |
Hi,
With this setup:
import { createUploadLink } from "apollo-upload-client"
...
I got an error : TypeError: Object(...) is not a function coming from webpack_require
But with:
import { createHttpLink } from "apollo-link-http"
...
It works
Do I miss something?
The text was updated successfully, but these errors were encountered: