意外的令牌,预期{
在我的.flowConfig中,我在选项下添加了 enums = true
:
[options]
enums=true
但是我遇到了此错误,并且使用createActapp创建的应用不想编译此枚举。
Unexpected token, expected "{" (2:7)
1 | // @flow
> 2 | export enum Variant {
| ^
3 | Primary = 'primary',
4 | Secondary = 'secondary',
5 | Success = 'success',
我一直在谷歌搜索时没有运气,也许有人在这里解决了这个问题?
更新: 使用Create React App(2.0)创建新的应用程序后,我会遇到相同的错误,其中Flow声称:“ Create Apple App已经支持Flow。”可以在他们的页面上看到:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否完成了以下链接中提到的这些和其他提到的先决条件? (看来您当前的设置尚不支持枚举语法
新的语法
管道
(从转换的输出中调用)
有关详细信息的部分
,请参阅本文:
href =“ https://medium.com/flow-type/introducing-flow-enums-16d4239b3180” rel =“ nofollow noreferrer”
< a href =“ https://flow.org/en/docs/enums/enabling-enums/” rel =“ nofollow noreferrer”>在项目中启用枚举
Have you done prerequisites including these and others that are mentioned in the following links? (It seems your current setting does not support enum syntax yet)
the new syntax
pipeline
(called from the output of the transform)
section
For details refer to this this post:
Introducing Flow Enums
Enabling enums in your project