Skip to content

Commit 0f58869

Browse files
committed
Add Module parse failed error to FAQ
Refs #573
1 parent 71cb85a commit 0f58869

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,26 @@ format('select [col] from tbl', { language: 'transactsql' });
193193

194194
Or when using the VSCode extension: Settings -> Prettier-SQL: SQLFlavourOverride.
195195

196+
### Module parse failed: Unexpected token
197+
198+
This typically happens when bundling an appication with Webpack.
199+
The cause is that Babel (through `babel-loader`) is not configured
200+
to support class properties syntax:
201+
202+
```
203+
| export default class ExpressionFormatter {
204+
> inline = false;
205+
```
206+
207+
This syntax is widely supported in all major browsers (except old IE)
208+
and support for it is included to the default `@babel/preset-env`.
209+
210+
Possible fixes:
211+
212+
- Update to newer Babel / Webpack
213+
- Switch to `@babel/preset-env`
214+
- Include plugin `@babel/plugin-proposal-class-properties`
215+
196216
## Contributing
197217

198218
Please see [CONTRIBUTING.md](CONTRIBUTING.md)

0 commit comments

Comments
 (0)