pulumi/pulumi · error · ResourceError
Resource name is not available, this resource instance must
Error message
Resource name is not available, this resource instance must have been constructed by an old SDK
What it means
The SDK records the constructor-time name on each resource instance in the internal __name field. resourceName() throws this error when that field is undefined, which can only happen if the instance was created by an SDK version that predates this field. It guards against silent misbehavior when engine callbacks inspect resources from an old SDK.
Source
Thrown at sdk/nodejs/resource.ts:1912
if (parts.length === 3) {
return parts[0];
}
return undefined;
}
/**
* The Pulumi type assigned to the resource at construction, of the form `package:module:name`.
*/
export function resourceType(res: Resource): string {
return res.__pulumiType;
}
/**
* The Pulumi name assigned to the resource at construction, i.e. the "name" in its constructor call.
*/
export function resourceName(res: Resource): string {
if (res.__name === undefined) {
throw new ResourceError(
"Resource name is not available, this resource instance must have been constructed by an old SDK",
res,
);
}
return res.__name;
}
View on GitHub (pinned to 793f7b2e16)
Solutions
- Upgrade the dependency package that constructs the resource to use a current @pulumi/pulumi version
- Deduplicate @pulumi/pulumi with 'npm ls @pulumi/pulumi' and resolve so only one version is installed
- Re-run 'npm install' / lockfile update so the provider code and runtime share the same SDK
Defensive patterns
Strategy: type-guard
Validate before calling
if (typeof (res as any).__name === "undefined") { throw new Error("resource built by old SDK"); } Type guard
function hasResourceName(res: pulumi.Resource): res is pulumi.Resource & { __name: string } { return typeof (res as any).__name === "string"; } Prevention
- Keep a single @pulumi/pulumi version across the program and dependencies
- Run 'npm ls @pulumi/pulumi' to detect duplicate versions
- Upgrade provider libraries alongside the CLI
When it happens
Trigger: Mixing SDK versions in one program (e.g. a dependency library constructing resources with an old @pulumi/pulumi while the runtime uses a newer one), so resourceName() is called on an instance lacking __name.
Common situations: Stale node_modules with duplicate @pulumi/pulumi copies at different versions; a provider SDK package pinning an ancient @pulumi/pulumi dependency; partially upgraded monorepos.
Related errors
- Do not supply 'providers' option to a CustomResource. Did yo
- Error reading file '${path}' when computing package dependen
- could not publish policies because of error running npm pack
- loading resource '%v': %w
- unknown resource type '%v'
AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31).
Data as JSON: /api/errors/494b2cb07e975818.
Report an issue: GitHub.