Cannot extend an interface 'DurableObject'. Did you mean 'implements'?

I have this tsconfig.json:
{
"compilerOptions": {
// Environment setup & latest features
"lib": ["ESNext"],
"target": "ESNext",
"module": "Preserve",
"moduleDetection": "force",
"jsx": "react-jsx",
"types": ["./worker-configuration.d.ts"],
"allowJs": true,

// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,

// Some stricter flags (disabled by default)
"noUnusedLocals": true,
"noUnusedParameters": true,
"noPropertyAccessFromIndexSignature": true
},
"include": ["src/**/*.ts"]
}
{
"compilerOptions": {
// Environment setup & latest features
"lib": ["ESNext"],
"target": "ESNext",
"module": "Preserve",
"moduleDetection": "force",
"jsx": "react-jsx",
"types": ["./worker-configuration.d.ts"],
"allowJs": true,

// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,

// Some stricter flags (disabled by default)
"noUnusedLocals": true,
"noUnusedParameters": true,
"noPropertyAccessFromIndexSignature": true
},
"include": ["src/**/*.ts"]
}
This is all I'm trying to do right now with my Durable Object:
export class UserStateDO extends DurableObject<Env> {
constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env)

console.log('we have Constructed very hard')
}
}
export class UserStateDO extends DurableObject<Env> {
constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env)

console.log('we have Constructed very hard')
}
}
And my wrangler config is pretty simple:
{
"name": "rizz-chat-api",
"main": "src/index.ts",
"compatibility_date": "2025-06-08",
"workers_dev": false,
"durable_objects": {
"bindings": [
{
"name": "USER_STATE_DO",
"class_name": "UserStateDO"
}
]
},
"migrations": [
{
"tag": "v1",
"new_sqlite_classes": ["UserStateDO"]
}
]
}
{
"name": "rizz-chat-api",
"main": "src/index.ts",
"compatibility_date": "2025-06-08",
"workers_dev": false,
"durable_objects": {
"bindings": [
{
"name": "USER_STATE_DO",
"class_name": "UserStateDO"
}
]
},
"migrations": [
{
"tag": "v1",
"new_sqlite_classes": ["UserStateDO"]
}
]
}
For some reason, I get this error out:
src/state_do/index.ts(1,34): error TS2689: Cannot extend an interface 'DurableObject'. Did you mean 'implements'?
src/state_do/index.ts(1,34): error TS2689: Cannot extend an interface 'DurableObject'. Did you mean 'implements'?
So that's odd. Haven't had this issue in other projects with Durable Objects, and it seems like it's never been documented here or anywhere else.
3 Replies
Queen Elizabeth II
Queen Elizabeth IIOP6mo ago
oh wow i've not had a big smart moment have i should have done import { DurableObject } from 'cloudflare:workers' first that's why it didn't work
mudkip
mudkip6mo ago
Sup Shroom
atgctg
atgctg6mo ago
I had to add this path to tsconfig:
"paths": {
"cloudflare:workers": ["./worker-configuration.d.ts"] // fixes DurableObject import
},
"paths": {
"cloudflare:workers": ["./worker-configuration.d.ts"] // fixes DurableObject import
},

Did you find this page helpful?