[babel] Fix default value for `environment` option
When an `environment` isn't explicitly provided by the user's config, we used to default this to `null` in `parsePluginOptions` which is called right at the start of the Babel plugin. These parsed options were then being passed to zod, which was expecting an object type, not null. Zod can reify a default config based on the schema, if an empty object is passed in. So by changing our default value to `{}` this should fix the compiler bailing out incorrectly on valid compiler options Test plan: tested this manually on the external repo by modifying node_modules
Lauren Tan committed
Nov 7, 2023 at 18:58 UTC
9d5ff320badcb81c914a010105fc033c2a595d4c
1 file changed
+1
-1
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Options.ts
+1
-1
@@ -146,7 +146,7 @@ export type Logger = {
146
export const defaultOptions: PluginOptions = {
147
compilationMode: "infer",
148
panicThreshold: "CRITICAL_ERRORS",
149
- environment: null,
149
+ environment: {},
150
logger: null,
151
gating: null,
152
instrumentForget: null,