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.

1.0.0 - Unexpected token = with static properties

See original GitHub issue

With 0.1.0 and 0.1.1, this was fine

export default class Root extends React.Component {
  static propTypes = {
    ...
  }
...

After switching to 1.0.0, eslint complains about Parsing error: Unexpected token =, referring to the=afterpropTypes`.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:54
  • Comments:16

github_iconTop GitHub Comments

71reactions
tomasz-szymanekcommented, Mar 15, 2016

But we are using es7 static properties now, and eslint still complains about it!

66reactions
ljharbcommented, Jun 28, 2016

Yes, the transform would go in whatever runs babel. You need to add a root "parser": "babel-eslint" as well.

This isn’t the proper venue for this kind of help tho - please feel free to join babel’s slack, or our gitter channel, or freenode on IRC.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: Unexpected token static - Stack Overflow
This error occurs since Standard ES2015(ES6) classes can only have methods, not properties. For me, ...
Read more >
How I Fixed The Unexpected Token Error In Jest
I saw it on line 1, because line 1 is almost always occupied by an import statement - and there are no import...
Read more >
Syntax Error When Using "targets" - Hotwire Discussion
Unexpected token for static targets = ["ingredient"] in Webpack. I am receiving this after updating to 1.0 and using the new targets functionality....
Read more >
Class Constants - Manual - PHP
It's possible to reference the class using a variable. ... unexpected '$CONSTANT' (T_VARIABLE), expecting identifier (T_STRING) in constant.php
Read more >
Efficient Default Property Values in TypeScript
Unexpected token. A constructor, method, accessor, or propert was expected. Therefore we settled on the convention of the protected static ...
Read more >

github_iconTop Related Medium Post

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