Caveats

Here are two worthy caveats from the comments.

Either you want user to be of type User | {} or Partial<User>, or you need to redefine the User type to allow an empty object. Right now, the compiler is correctly telling you that user is not a User. – jcalz

I don't think this should be considered a proper answer because it creates an inconsistent instance of the type, undermining the whole purpose of TypeScript. In this example, the property Username is left undefined, while the type annotation is saying it can't be undefined. – Ian Liu Rodrigues

Answer

One of the design goals of TypeScript is to "strike a balance between correctness and productivity." If it will be productive for you to do this, use Type Assertions to create empty objects for typed variables.

type User = {
    Username: string;
    Email: string;
}

const user01 = {} as User;
const user02 = <User>{};

user01.Email = "[email protected]";

Here is a working example for you.

Answer from Shaun Luttin on Stack Overflow
🌐
Total TypeScript
totaltypescript.com › the-empty-object-type-in-typescript
The Empty Object Type in TypeScript | Total TypeScript
April 2, 2024 - This is because TypeScript's type system is structural, not nominal. Everything except null and undefined is an object, so everything can be assigned to an empty object. If you want to represent an empty object, use Record<string, never> instead.
Discussions

Initialize empty object in typescript with Record type - Stack Overflow
How to define and initialize an object that can be empty. With types type Plan = 'plan1' | 'plan1'; interface IPlan { name: string } When I tried to initialize an empty object, I'm getting an ... More on stackoverflow.com
🌐 stackoverflow.com
Empty object type is not working
Bug Report 🔎 Search Terms Empty object Typescript 🕗 Version & Regression Information This is the behavior in every version I tried, and I reviewed all of the FAQ's entries. ⏯ Playground Lin... More on github.com
🌐 github.com
12
January 18, 2022
Generic record key (string | number) doesn't allow an empty record
Bug Report When a record with a generic key is assigned an empty object (a object with zero properties), I am given an TS error that Type '{}' is not assignable to type 'Record '.(2322). The use-case was to convert a edge list to ... More on github.com
🌐 github.com
4
February 2, 2022
Empty object should default type to Record<string, unknown>
This feature would agree with the rest of TypeScript's Design Goals. Type empty object literal {} as Record. More on github.com
🌐 github.com
3
June 8, 2021
People also ask

What is an empty object in TypeScript?
An empty object in TypeScript is represented by `{}`. It does not mean an object with no properties but rather an unrestricted object type that can accept any object. However, it cannot hold primitive types like string, number, or boolean. Unlike `Record`, which prevents additional properties, `{}` allows any object to be assigned.
🌐
dhiwise.com
dhiwise.com › blog › design-converter › typescript-empty-object-guide-best-practices
Understanding the TypeScript Empty Object
How to check if an object is empty in TypeScript?
An empty object can be checked by verifying whether it has any keys. Since TypeScript does not provide built-in methods for this, checking the length of `Object.keys(obj)` is a common approach. If `Object.keys(obj).length` is zero, the object is considered empty.
🌐
dhiwise.com
dhiwise.com › blog › design-converter › typescript-empty-object-guide-best-practices
Understanding the TypeScript Empty Object
Is null or empty in TypeScript?
In TypeScript, `null` and an empty object are different. `null` is a non-nullish value that represents the intentional absence of an object, whereas `{}` is a valid object. An empty object is not the same as `null`, and TypeScript does not consider them equivalent unless explicitly handled using a union type.
🌐
dhiwise.com
dhiwise.com › blog › design-converter › typescript-empty-object-guide-best-practices
Understanding the TypeScript Empty Object
🌐
Reddit
reddit.com › r/typescript › defining "record which is empty before initialisation and should never be empty after initialisation"?
r/typescript on Reddit: Defining "record which is empty before initialisation and should never be empty after initialisation"?
June 24, 2023 -

Let's say I have

const someObject = {};
const ObjectKeys = ["a", "b", "c", "d", ... ] as const;
type ObjectKeyType = typeof ObjectKeys[number];

let initialised = false;
function init() {
    // Do stuff
    initialised = true;
} 

After init is called, someObject always satisfies the type Record<ObjectKeyType, SomeOtherType>, but before that it's empty. I get around this by setting someObject to a partial of the record, but then that means every single time I access a property of someObject later I have to check whether or not it's undefined when really I should just have to check initialised at the start of the function and return early if it's false.

Is there a convenient way to tell typescript "Hey, if initialised is true then someObject should always be a complete record instead of only a partial one"?

🌐
GitHub
github.com › microsoft › TypeScript › issues › 47486
Empty object type is not working · Issue #47486 · microsoft/TypeScript
January 18, 2022 - Playground link with relevant code · const emptyObject: Record<string, never> = {}; console.log(emptyObject.id); // Should warn, but doesn't const nonEmptyObject: Record<'a', unknown> = { a: 1 }; console.log(nonEmptyObject.id); // Warning: ...
Author   Asaf-S
Find elsewhere
🌐
DhiWise
dhiwise.com › blog › design-converter › typescript-empty-object-guide-best-practices
Understanding the TypeScript Empty Object
March 3, 2025 - The way TypeScript handles empty objects depends on type rules, object literals, and assignable values.
🌐
GeeksforGeeks
geeksforgeeks.org › typescript › how-to-check-if-an-object-is-empty-in-typescript
How to Check if an Object is Empty in TypeScript ? - GeeksforGeeks
July 23, 2025 - Converting the object into a JSON string allows for easy checking if it's empty by verifying the length of the resulting string. Example: This example shows the use of the above-explained approach. ... const obj7: Record<string, any> = {}; const obj8: Record<string, any> = { language: "TypeScript", version: "4.5" }; if (JSON.stringify(obj7) === '{}') { console.log('obj7 is empty'); } else { console.log('obj7 is not empty'); } if (JSON.stringify(obj8) === '{}') { console.log('obj8 is empty'); } else { console.log('obj8 is not empty'); }
🌐
GitHub
github.com › microsoft › TypeScript › issues › 44503
Empty object should default type to Record<string, unknown> · Issue #44503 · microsoft/TypeScript
June 8, 2021 - When using the type object type {}, TypeScript provides a nice error message: Don't use {}as a type.{} actually means "any non-nullish value".. but by default, empty object is typed as {}: const y = {} // y: {}
Author   unional
🌐
Reddit
reddit.com › r/typescript › how to declare empty object in typescript?
r/typescript on Reddit: How to declare empty object in TypeScript?
September 12, 2021 -

I know this is a really basic question, and I've tried to look at similar questions and didn't understand it so I apologize.

I'm translating my JavaScript code to TypeScript, and have a lot of code that looks similar to this:

	if (!user_dict.options) {
		user_dict.options = {}
	}

This produces the error "property options does not exist on type {}" for both lines. How can I establish an empty object like this, if I don't know what type of variables will later be stored? I have hundreds of empty variable declarations like this, and I can't know at this point in the code the "type" of variable being stored later, so I don't understand how I'm supposed to handle this using TypeScript?

🌐
Tim Mousk
timmousk.com › blog › typescript-empty-object
How To Initialize An Empty Typed Object In TypeScript? – Tim Mouskhelichvili
March 2, 2023 - Another option to initialize an empty typed object is to use the TypeScript partial utility type. ... The issue with this technique is that all of the properties of your object become optional, which is something you may not want. The most suitable option, in my opinion, is to initialize an empty typed object using the record utility type.
🌐
Mercury
mercury.com › blog › creating-an-emptyobject-type-in-typescript
Creating an EmptyObject type in TypeScript | Mercury
September 19, 2023 - In TypeScript, it is impossible to use the type {} to express “this object should be empty.” Depending on your experience with TypeScript, you may have been frustrated by this before, or you might be surprised that this is a problem worth ...
🌐
Webdevtutor
webdevtutor.net › blog › typescript-record-allow-empty-object
How to Allow Empty Objects in TypeScript Records
By using Partial, each property ... object, you can simply do so as follows: ... By initializing the object without specifying any properties, TypeScript infers the type as EmptyObjectRecord and allows it to remain empty....
🌐
Codú
codu.co › home › feed › niall maher › how to type empty objects in typescript
How to Type Empty Objects in TypeScript | by Niall Maher | Codú
July 21, 2023 - To declare an object as an object with no properties, we have to be more explicit: ... Now if we tried to assign a value we will start seeing type errors. type EmptyObject = Record<PropertyKey, never>; // ❌ Fails the Type check: Type 'string' ...
🌐
Webdevtutor
webdevtutor.net › blog › typescript-record-empty
Understanding TypeScript Record Empty: A Comprehensive Guide
In TypeScript, an empty record refers to an object that has no properties defined within it. This means that the record does not have any keys or associated values.
🌐
Webdevtutor
webdevtutor.net › blog › typescript-record-or-empty-object
TypeScript Record Type vs Empty Object: Understanding the Differences
In the example above, the User type is defined using Record<string, string>, indicating that the keys must be strings, and the corresponding values must also be strings. On the other hand, an empty object in TypeScript is simply an object literal with no properties.