diff --git a/packages/studio-server/src/codemods/update-default-props.ts b/packages/studio-server/src/codemods/update-default-props.ts
index 29a800de536..5318aee592d 100644
--- a/packages/studio-server/src/codemods/update-default-props.ts
+++ b/packages/studio-server/src/codemods/update-default-props.ts
@@ -111,7 +111,7 @@ export const updateDefaultProps = async ({
defaultPropsValue.type !== 'TSAsExpression'
) {
throw new Error(
- `\`defaultProps\` prop must be a hardcoded value in the tag with the ID "${defaultPropsValue.type}".`,
+ `\`defaultProps\` prop must be a hardcoded value in the tag with the ID "${compositionId}".`,
);
}