Skip to content

Commit f7b32f7

Browse files
fix(qualtrics): move qualtricsSchema after trackedLinkParamSchema to fix TDZ error
qualtricsSchema referenced trackedLinkParamSchema before it was defined, causing a ReferenceError at module load time that crashed batch creation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 77b1406 commit f7b32f7

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

server/src/preFlight/validateTreatmentFile.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -728,19 +728,6 @@ const promptShorthandSchema = fileSchema.transform((str) => {
728728
return newElement;
729729
});
730730

731-
const qualtricsSchema = elementBaseSchema
732-
.extend({
733-
type: z.literal("qualtrics"),
734-
url: urlSchema,
735-
params: z
736-
.array(trackedLinkParamSchema, {
737-
invalid_type_error:
738-
"Expected an array for `params`. Make sure each item starts with a dash (`-`) in YAML.",
739-
})
740-
.optional(),
741-
})
742-
.strict();
743-
744731
const separatorSchema = elementBaseSchema
745732
.extend({
746733
type: z.literal("separator"),
@@ -814,6 +801,19 @@ const trackedLinkParamSchema = z
814801
}
815802
});
816803

804+
const qualtricsSchema = elementBaseSchema
805+
.extend({
806+
type: z.literal("qualtrics"),
807+
url: urlSchema,
808+
params: z
809+
.array(trackedLinkParamSchema, {
810+
invalid_type_error:
811+
"Expected an array for `params`. Make sure each item starts with a dash (`-`) in YAML.",
812+
})
813+
.optional(),
814+
})
815+
.strict();
816+
817817
// Element for instrumented external links (see client/src/elements/TrackedLink.jsx).
818818
// We validate the static fields plus the structured urlParams array so that Typos get caught at preflight.
819819
const trackedLinkSchema = elementBaseSchema

0 commit comments

Comments
 (0)