Skip to content

Commit bb05220

Browse files
committed
Fix Babel compilation error
The default Storybook Babel config did not recognize the `public` keyword in our custom errors (e.g. `ExhaustivityCheckingError` and `RedactableError`). To fix this, we can use Storybook's V7 mode to supply a custom Babel config. This fixes the compilation error. See: https://storybook.js.org/docs/react/configure/babel
1 parent 1bcc13a commit bb05220

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

extensions/ql-vscode/.babelrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"sourceType": "unambiguous",
3+
"presets": [
4+
[
5+
"@babel/preset-env",
6+
{
7+
"targets": {
8+
"chrome": 100
9+
}
10+
}
11+
],
12+
"@babel/preset-typescript",
13+
"@babel/preset-react"
14+
],
15+
"plugins": []
16+
}

extensions/ql-vscode/.storybook/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ const config: StorybookConfig = {
1212
core: {
1313
builder: "@storybook/builder-webpack5",
1414
},
15+
features: {
16+
babelModeV7: true,
17+
},
1518
};
1619

1720
module.exports = config;

0 commit comments

Comments
 (0)