Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500: Illegal invocation #1

Open
sinitsa opened this issue Oct 23, 2022 · 1 comment
Open

500: Illegal invocation #1

sinitsa opened this issue Oct 23, 2022 · 1 comment

Comments

@sinitsa
Copy link

sinitsa commented Oct 23, 2022

Hello! Trying to implement UsersAPI ...

export interface UserAPI {
signIn(user: SignInputSchema): ErrorResponse | SuccessResponse
getInfo(): UserSchema | undefined
getLogins(): UserLoginSchema[]
test(): any
}

export interface Env {
User: DurableObjectNamespaceExt
}

router
.all('*', withDurables)
.get('/auth/test', async (request: IRequest, { User }: Env) => {
return User.get('test').test()
})

It's example of a simplest interaction, but all seems like all durable calls ends up with {
"status": 500,
"error": "Illegal invocation"
}

In User class
....
function test() {
return 'Justa test...'
}
...
and everything exports without errors (has all defined functions, etc)
and everything cooked by your tutorial... but
Sorry i'm stuck here, any ideas??

@sinitsa
Copy link
Author

sinitsa commented Oct 24, 2022

So, i have tried just your example - Counter, as additional DO and sub-router ...
Result is the same :(( {
"status": 500,
"error": "Illegal invocation"
}

Without withDurables it's just Failed to execute 'get' on 'DurableObjectNamespace': parameter 1 is not of type 'DurableObjectId'." , so withDurables - works, but with some troubles....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant