TypeError: _super.call is not a function
See original GitHub issueIntended outcome: Trying to get the basic react + apollo setup from the docs going
Actual outcome:
opaque error saying TypeError: _super.call is not a function
. Full stack trace is here:
Uncaught (in promise) TypeError: _super.call is not a function
at new ObservableQuery (b1f6a7d9f98d979758232d0dc3c394ce.js:26213)
at QueryManager.watchQuery (b1f6a7d9f98d979758232d0dc3c394ce.js:27305)
at b1f6a7d9f98d979758232d0dc3c394ce.js:27332
at new Promise (<anonymous>)
at QueryManager.query (b1f6a7d9f98d979758232d0dc3c394ce.js:27330)
at ApolloClient.query (b1f6a7d9f98d979758232d0dc3c394ce.js:27981)
at Object.require.2.react (b1f6a7d9f98d979758232d0dc3c394ce.js:29740)
at newRequire (b1f6a7d9f98d979758232d0dc3c394ce.js:41)
at require.39 (b1f6a7d9f98d979758232d0dc3c394ce.js:66)
at b1f6a7d9f98d979758232d0dc3c394ce.js:71
How to reproduce the issue: just following the docs at https://www.apollographql.com/docs/react/basics/setup.html
import { ApolloClient } from "apollo-client";
import { HttpLink } from "apollo-link-http";
import { InMemoryCache } from "apollo-cache-inmemory";
import gql from "graphql-tag";
const client = new ApolloClient({
link: new HttpLink({ uri: "https://q80vw8qjp.lp.gql.zone/graphql" }),
cache: new InMemoryCache()
});
client
.query({query: gql`{hello}`})
.then(console.log);
i see related issues here and here but nobody seems to have filed it in this repo yet so here i am doing it.
Version
- apollo-client@2.1.0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:27 (5 by maintainers)
Top Results From Across the Web
Typescript: calling super method from extended class gives ...
You end up with Object.getPrototypeOf(this).undefined() , and undefined is indeed not a function, so you get a TypeError: (intermediate value) ...
Read more >super - JavaScript - MDN Web Docs - Mozilla
The super keyword is used to access properties on an object literal or class's [[Prototype]], or invoke a superclass's constructor.
Read more >Class inheritance - The Modern JavaScript Tutorial
Class syntax allows to specify not just a class, but any expression after extends . For instance, a function call that generates the...
Read more >[JavaScript] Can't call _super() in an asynchronous call - Odoo
I need to pass 'newRecords' to the parent init function but what I get is TypeError: self._super is not a function. Please help....
Read more >TypeError (intermediate value)(...) is not a function in JS
The "TypeError: (intermediate value)(...) is not a function" error occurs when we forget to place a semicolon between a function declaration and an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sw-yx No parcel-bundler to me. The issue is that I am using babel not typescript and the js version of apollo-link is using the wrong import (From babel point of view). I suggest apollo to provide a compiled ES5 version from the ts complier to resolve this issue.
Following apollo-link issue #248 , my workaround is by changing
node_modules/apollo-link/lib/index.js:3
from:import * as Observable from 'zen-observable';
to:
import Observable from 'zen-observable';