File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -124,3 +124,21 @@ const MyEnum = {
124
124
]
125
125
}
126
126
```
127
+
128
+ ## Troubleshooting
129
+
130
+ ### ` SyntaxError `
131
+
132
+ You may be getting a ` SyntaxError ` because you are running this plugin on
133
+ non-TypeScript source. You might have run into this problem in ` react-native ` ,
134
+ see:<br >
135
+ [ babel-plugin-const-enum #2 ] ( https://github.com/dosentmatter/babel-plugin-const-enum/issues/2 ) <br >
136
+ [ babel-plugin-const-enum #3 ] ( https://github.com/dosentmatter/babel-plugin-const-enum/issues/3 )
137
+
138
+ This seems to be caused by ` react-native ` transpiling
139
+ [ ` flow ` ] ( https://flow.org/ ) code in ` node_modules ` .
140
+ To fix this issue, please use
141
+ [ ` babel-preset-const-enum ` ] ( https://github.com/dosentmatter/babel-preset-const-enum )
142
+ to only run ` babel-plugin-const-enum ` on TypeScript files.
143
+ If you wish to fix the issue manually, check out the
144
+ [ solution in babel-plugin-const-enum #2 ] ( https://github.com/dosentmatter/babel-plugin-const-enum/issues/2#issuecomment-542859348 ) .
You can’t perform that action at this time.
0 commit comments