question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: _super.call is not a function

See original GitHub issue

Intended 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:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:27 (5 by maintainers)

github_iconTop GitHub Comments

9reactions
kinyatcommented, Jan 19, 2018

@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.

7reactions
dedencommented, Dec 28, 2017

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';

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found