dagger/dagger · error

failed to update tsconfig paths %s: %w

Error message

failed to update tsconfig paths %s: %w

What it means

Same family as the other tsconfig update errors, but this one is specific to setting the `@dagger.io/dagger/telemetry` path alias in a module tsconfig, with the alias name interpolated into the message for diagnosis. It indicates sjson could not apply the telemetry alias mapping, almost always because the surrounding tsconfig JSON is malformed or the paths value is not an object.

Source

Thrown at sdk/typescript/runtime/tsutils/tsconfig_updator.go:42

func UpdateTSConfigForModule(tsConfig string) (string, error) {
	tsConfig = removeJSONComments(tsConfig)

	// Add path."@dagger.io/dagger"=["./sdk/index.ts"]
	tsConfig, err := sjson.Set(tsConfig,
		"compilerOptions.paths."+gjson.Escape(daggerLibPathAlias),
		[]string{daggerLibPath},
	)
	if err != nil {
		return "", fmt.Errorf("failed to update tsconfig paths: %w", err)
	}

	// Add path."@dagger.io/dagger/telemetry"=["./sdk/telemetry.ts"]
	tsConfig, err = sjson.Set(tsConfig,
		"compilerOptions.paths."+gjson.Escape(daggerTelemetryPathAlias),
		[]string{daggerTelemetryLibPath},
	)
	if err != nil {
		return "", fmt.Errorf("failed to update tsconfig paths %s: %w", daggerTelemetryPathAlias, err)
	}

	// Add compilerOptions.experimentalDecorators=true
	tsConfig, err = sjson.Set(tsConfig, "compilerOptions.experimentalDecorators", true)
	if err != nil {
		return "", fmt.Errorf("failed to update tsconfig experimentalDecorators: %w", err)
	}

	return tsConfig, nil
}

func UpdateTSConfigForClient(tsConfig string, isRemote bool) (string, error) {
	tsConfig = removeJSONComments(tsConfig)

	// If the dagger library is remote, we don't need to override @dagger.io/dagger
	// and @dagger.io/dagger/telemetry
	if isRemote {
		return tsConfig, nil

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Repair tsconfig.json to valid JSON with paths as an object
  2. Regenerate via `dagger develop`
  3. Ensure no duplicate/overriding `paths` key appears later in compilerOptions
  4. If using JSONC features, keep codegen-managed keys minimal or let Dagger own the file
Defensive patterns

Strategy: validation

Validate before calling

const cfg = JSON.parse(fs.readFileSync('tsconfig.json', 'utf8'));
if (typeof cfg.compilerOptions?.paths !== 'object' || cfg.compilerOptions.paths === null) {
  cfg.compilerOptions = cfg.compilerOptions || {};
  cfg.compilerOptions.paths = {};
}
fs.writeFileSync('tsconfig.json', JSON.stringify(cfg, null, 2));

Try / catch

try {
  const tsconfig = await createOrUpdateTSConfigForModule(...)
} catch (e) {
  if (String(e).includes('@dagger.io/dagger/telemetry')) {
    // tsconfig JSON is invalid; repair and retry
  }
  throw e;
}

Prevention

When it happens

Trigger: sjson.Set on `compilerOptions.paths.@dagger.io/dagger/telemetry` fails because the tsconfig string is invalid JSON or `paths` holds a scalar/array instead of an object.

Common situations: Telemetry alias added in newer SDK versions colliding with an older hand-written tsconfig where paths was redefined; JSONC syntax not accepted; truncated file from a failed write.

Related errors


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/db9927f76fbb0ea0. Report an issue: GitHub.