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

Use structuredClone after replacing vm2 #1153

Open
danielpeintner opened this issue Nov 6, 2023 · 0 comments
Open

Use structuredClone after replacing vm2 #1153

danielpeintner opened this issue Nov 6, 2023 · 0 comments

Comments

@danielpeintner
Copy link
Member

danielpeintner commented Nov 6, 2023

Thank you, @danielpeintner, for providing this fix! After also doing some more research, I discovered that the problem might be related to vm2, since the error does not occur if you perform a structuredClone of an ExposedThingInit before passing it to the produce method (which I found pretty odd). Apparently, vm2 wraps unprocessed JavaScript objects somehow, so that they are not compatible with structuredClone anymore. With the old parse-stringify approach, this problem does not seem to be present.

I guess we could revisit using the more recommended structuredClone once again when a replacement for vm2 has been added to the code. For now, maybe we need to make sure that the problem does not appear in other CLI-related contexts as well.

Originally posted by @JKRhb in #1152 (comment)

relates to #1105 and #1035

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