eclipse-thingweb / eclipse-thingweb/node-wot

Use structuredClone after replacing vm2

Open
#1,153 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
192
Forks
100
Avg merge
3d 2h
Merged PRs (30d)
6

Description

> 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 https://github.com/eclipse-thingweb/node-wot/issues/1152#issuecomment-1793459137_

relates to https://github.com/eclipse-thingweb/node-wot/pull/1105 and https://github.com/eclipse-thingweb/node-wot/issues/1035

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.