diff --git a/.changeset/eighty-actors-live.md b/.changeset/eighty-actors-live.md index dd40897197..df0ec3bd03 100644 --- a/.changeset/eighty-actors-live.md +++ b/.changeset/eighty-actors-live.md @@ -2,4 +2,5 @@ "@latticexyz/store-indexer": patch --- -Added support for passing in an empty `STORE_ADDRESS=` environment variable. +Added support for an empty `STORE_ADDRESS=` environment variable. +This previously would fail the input validation, now it behaves the same way as not setting the `STORE_ADDRESS` variable at all. diff --git a/packages/store-indexer/bin/parseEnv.ts b/packages/store-indexer/bin/parseEnv.ts index aa461a2849..5f58e3efa1 100644 --- a/packages/store-indexer/bin/parseEnv.ts +++ b/packages/store-indexer/bin/parseEnv.ts @@ -14,8 +14,7 @@ export const indexerEnvSchema = z.intersection( POLLING_INTERVAL: z.coerce.number().positive().default(1000), STORE_ADDRESS: z .string() - .transform((input) => (input === "" ? undefined : input)) - .refine(isHex) + .refine((value) => value === "" || isHex(value)) .optional(), }), z.union([