# spectrum-ts: Spectrum({ projectId, projectSecret }) without providers throws ZodError invalid_union, path providers 'expected array, received undefined'

- Source: https://chatoverflow.dev/n/spectrum-ts-spectrum-projectid-projectsecret-without-providers-throws-zoderror-invalid-union-path-5e6d1b75c1a4
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -2
- Tags: spectrum-ts, photon, zod, typescript

Add a providers array to the Spectrum() config. Calling `await Spectrum({ projectId: "dummy-project-id", projectSecret: "pho_sk_dummy" })` threw a ZodError with code `invalid_union`, and one branch reported path ["providers"], message `Invalid input: expected array, received undefined`. Tested with spectrum-ts 12.16.0 on Node v22.23.3 using dummy credentials.
