create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

SyntaxError: super() outside of class constructor

Open LeeTwelve opened this issue 10 years ago • 13 comments

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?

LeeTwelve avatar Dec 02 '16 17:12 LeeTwelve

Does line 7 have a typo? construtor => constructor

existentialism avatar Dec 02 '16 18:12 existentialism

Oh my gosh I spent 20 min with "contructor" instead "constructor"

jricaldi avatar Mar 12 '17 03:03 jricaldi

Had same issue.. thanks @existentialism

kelleysy avatar Mar 12 '17 23:03 kelleysy

Idem :D

giaesp avatar May 11 '17 09:05 giaesp

This will be solved in https://github.com/babel/babylon/pull/408 with better error message.

gaearon avatar May 11 '17 13:05 gaearon

omg! It's kinda weird all getting typos with constructor ! ME TOO :+1: LOL

tracygipson avatar Jun 30 '17 09:06 tracygipson

:+1:

shuang920 avatar Jul 14 '17 01:07 shuang920

Glad that I found this post, have been reviewing the code from past 1 hour. lol

kaydeveloper avatar Aug 01 '17 02:08 kaydeveloper

This just happened to me now lol

mwlalata avatar Sep 13 '17 09:09 mwlalata

Same here.

mvkotekar avatar Sep 18 '17 17:09 mvkotekar

this happened to me twice...NOT HAPPENING AGAIN!

muganwas avatar Oct 09 '17 22:10 muganwas

same here!!! Good job.

YiChunHung avatar Nov 14 '17 12:11 YiChunHung

All,

I'll mute this issue since so many of you are involved -- this should be fixed soon as Babel 7 is on the horizon.

Thanks!

Timer avatar Nov 14 '17 12:11 Timer