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.

SyntaxError: super() outside of class constructor

See original GitHub issue

Hi, I getting error from manual on Facebook docs.

Failed to compile.

Error in ./src/App.js
Syntax error: super() outside of class constructor (8:4)

   6 | 
   7 |   construtor() {
>  8 |     super()
     |     ^

 @ ./src/index.js 13:11-27

npm -v = 4.0.3 node -v = 7.1.0

What’s wrong with this syntax?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

32reactions
existentialismcommented, Dec 2, 2016

Does line 7 have a typo? construtor => constructor

19reactions
jricaldicommented, Mar 12, 2017

Oh my gosh I spent 20 min with “contructor” instead “constructor”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: call super outside of class constructor
You call not the parent method, but parent constructor which is not valid call outside of the constructor. You need to use super.cool(val); ......
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 >
JavaScript Class constructor Method
This will throw a SyntaxError . You can use the super() method to call the constructor of a parent class (see "More Examples"...
Read more >
Classes [ES6] • JavaScript for impatient programmers ...
.constructor() is a special method that is called after the creation of a new instance. ... And they are invisible to the world...
Read more >
constructor-super - ESLint - Pluggable JavaScript Linter
Constructors of non derived classes must not call super() . ... "error"*/ /*eslint-env es6*/ class A { constructor() { super(); // This is...
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