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.

Unexpected token @ (mobx, react-native, flow)

See original GitHub issue

Prettier doesn’t work on this fragment of code:

import {observable} from 'mobx';

export default class KeyStore {
  @observable keys = [];
}
Unexpected token @ (keyStore.js:4:3)
  2 | 
  3 | export default class KeyStore {
> 4 |   @observable keys = [];
    |   ^
  5 | }

ESlint integration enabled. Installed plugins: Flow for Visual Studio Code, React Native VSCode Extension Pack, VS Code ESLint extension.

Probably flow parser issue.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
CiGitcommented, Apr 10, 2018

see prettier/prettier#4126

It is fine with babylon parser

0reactions
github-actions[bot]commented, Apr 13, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mobx + react unexpected token - Stack Overflow
I installed mobx and mobx-react ,but is still shows the error of unexpected token before @ symb. Do I need to add something...
Read more >
Enabling decorators · MobX
Enable the compiler option "experimentalDecorators": true and "useDefineForClassFields": true in your tsconfig.json . Babel 7. Install support for decorators ...
Read more >
mobxjs/mobx - Gitter
Hi all. For information, i have a build error during first integration of Mobx 4 (Unexpected token (3987:69) in .../node_modules/mobx/lib/mobx.module.js), ...
Read more >
Flow is giving me errors for React Native type definitions/code ...
Coding example for the question Flow is giving me errors for React Native type ... React Native starter project bundling fails with Unexpected...
Read more >
Exploring MobX-State-Tree References - React Native Live
Happy Friday! Let's do some more work on this MobX -State-Tree reference extension.
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