Skip to content

Commit 29a9bde

Browse files
committed
Add babel-preset-const-enum to README.md
Resolves: #2, #3
1 parent c88a703 commit 29a9bde

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,21 @@ const MyEnum = {
124124
]
125125
}
126126
```
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).

0 commit comments

Comments
 (0)