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

Bug: Calling a Service Binding RPC method throws a DOMException #139

Closed
JacobMarshallPP opened this issue May 21, 2024 · 0 comments · Fixed by #140
Closed

Bug: Calling a Service Binding RPC method throws a DOMException #139

JacobMarshallPP opened this issue May 21, 2024 · 0 comments · Fixed by #140

Comments

@JacobMarshallPP
Copy link
Contributor

When using this package and calling a Service Binding's RPC property - the following error is thrown.

DOMException {
  code: 25,
  name: 'DataCloneError',
  message: 'Could not serialize object of type "Fetcher". This type does not support serialization.'
}

It admittedly took me a while to figure out where this was coming from, but I finally narrowed it down to the following line of code:

const bound = value.bind(thisArg)

More specifically, it looks like calling .bind actually returns an RpcPromise, not a function. And then the actual error occurs when calling the "bound" function (which at this point is actually a promise-like object). I didn't spend too much time looking into that, but that was my initial assessment.

I have a fix for this locally, so I'm creating this issue to have an issue ID to reference in my pull request :)

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

Successfully merging a pull request may close this issue.

1 participant