#How do I debug and fix IntrospectionError

1 messages · Page 1 of 1 (latest)

restive smelt
#

I have a large configuration object schema that I'm defining with zod, then infering it's type like so.

const ConfigSchema = z.object({
  // ...
});

export type Config = z.infer<typeof ConfigSchema>;

This is used to load, parse, and validate a JSON file passed to a Dagger function.

@func()
private static async loadConfigFile(file: File): Promise<Config> {
  return ConfigSchema.parse(JSON.parse(await file.contents())) as Config;
}

However, when I try to import the module that exposes this loadConfigFile function I get an IntrospectionError.

Error logs:

✘ asModule getModDef 1.9s
/src/dagger/sdk/src/module/introspector/dagger_module/module.ts:278
      throw new IntrospectionError(  
     ^


IntrospectionError: could not resolve type reference for { aws?: { accessKeyId?: string; secretAccessKey?: string; sessionToken?: st
 docker?: { endpoint?: string; username?: string; password?: string; }; helm?: { plugins?: { url?: string; version?: string; }[]; re
...; }[]; }; service?: { ...; }; }.
    at DaggerModule.resolveReferences (/src/dagger/sdk/src/module/introspector/dagger_module/module.ts:278:13)
    at new DaggerModule (/src/dagger/sdk/src/module/introspector/dagger_module/module.ts:134:10)
    at scan (/src/dagger/sdk/src/module/introspector/index.ts:18:18)
    at async connection.LogOutput (/src/dagger/sdk/src/module/entrypoint/entrypoint.ts:17:26)
    at async <anonymous> (/src/dagger/sdk/src/connect.ts:44:11)
    at async withGQLClient (/src/dagger/sdk/src/common/graphql/connect.ts:24:12)
    at async <anonymous> (/src/dagger/sdk/src/connect.ts:40:9)
    at async connection (/src/dagger/sdk/src/connect.ts:38:5)
    at async entrypoint (/src/dagger/sdk/src/module/entrypoint/entrypoint.ts:11:3) {
  cause: undefined,
  code: 'D110'
}

Node.js v22.11.0