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, nilView on GitHub (pinned to 82ba2681db)
Solutions
- Repair tsconfig.json to valid JSON with paths as an object
- Regenerate via `dagger develop`
- Ensure no duplicate/overriding `paths` key appears later in compilerOptions
- 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
- Ensure paths is an object so the telemetry alias can be added
- Avoid JSONC syntax in codegen-managed tsconfigs
- Regenerate tsconfig after SDK version upgrades
- Check for duplicate compilerOptions keys in tsconfig
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
- failed to update tsconfig paths: %w
- failed to update tsconfig experimentalDecorators: %w
- failed to lookup for tsconfig.json: %w
- failed to read module's tsconfig.json: %w
- failed to update tsconfig.json: %w
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/db9927f76fbb0ea0.
Report an issue: GitHub.