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

Failed to execute 'structuredClone' on prepared vector #25

Open
rajsite opened this issue Feb 21, 2024 · 3 comments
Open

Failed to execute 'structuredClone' on prepared vector #25

rajsite opened this issue Feb 21, 2024 · 3 comments

Comments

@rajsite
Copy link

rajsite commented Feb 21, 2024

Trying to use the preparePostMessage and rehydrateVector helpers on the README example I get the error message:

Uncaught DOMException: Failed to execute 'structuredClone' on 'Window': (index) => isChunkedValid(unchunkedData, index) could not be cloned.

See stackblitz example: https://stackblitz.com/edit/geoarrow-readme-worker-example?file=src%2Fmain.ts&terminal=dev
And open devtools to see the error.

npm list:

+-- @esbuild/[email protected] extraneous
+-- @geoarrow/[email protected]
+-- @rollup/[email protected] extraneous
+-- @rollup/[email protected] extraneous
+-- [email protected]
+-- [email protected]
`-- [email protected]
@rajsite
Copy link
Author

rajsite commented Feb 21, 2024

Looks like the tests only cover Data and not Vector, maybe an issue has been introduced?

It does look like preparePostMessage(Data) and rehydrateData are working but the vector example shown in the README does not seem to.

@kylebarron
Copy link
Member

I don't think I ever tested it on Vector, despite implementing preparePostMessage on Vector and rehydrateVector.

Presumably the issue is that a few methods are assigned as attributes with function definitions https://github.com/apache/arrow/blob/6a22a1dee78b0f7daa7e4d8793d663e29a5712a6/js/src/vector.ts#L81-L84

@kylebarron
Copy link
Member

I figure that the best solution is to create a new object with only known properties https://github.com/apache/arrow/blob/6a22a1dee78b0f7daa7e4d8793d663e29a5712a6/js/src/vector.ts#L93-L97.

Are you interested in making a PR? It's probably just a couple lines here

return [vector, transferArrayBuffers];

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

2 participants