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

structuredClone does not work on process.env #45380

Closed
cruiseliu opened this issue Nov 8, 2022 · 3 comments · Fixed by #45698
Closed

structuredClone does not work on process.env #45380

cruiseliu opened this issue Nov 8, 2022 · 3 comments · Fixed by #45698
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.

Comments

@cruiseliu
Copy link

Version

v19.0.1

Platform

Linux x 6.0.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 03 Nov 2022 18:01:58 +0000 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

No response

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

> structuredClone(process.env)
Uncaught:
DOMException [DataCloneError]: Cannot transfer object of unsupported type.
    at new DOMException (node:internal/per_context/domexception:53:5)
    at structuredClone (node:internal/structured_clone:23:17)

Additional information

No response

@bnoordhuis
Copy link
Member

I'm not sure this is fixable. If it is, it probably involves teaching WriteHostObject() in src/node_messaging.cc about process.env through a v8::ObjectTemplate::HasInstance() check.

The template is created in CreateEnvVarProxy() in src/node_env_var.cc. It should be stored on the Environment so WriteHostObject() can access it as env_->env_proxy_template().

@bnoordhuis bnoordhuis added the c++ Issues and PRs that require attention from people who are familiar with C++. label Nov 12, 2022
@MrJithil
Copy link
Contributor

need help on this as its involved c++

@bnoordhuis
Copy link
Member

#45698

bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Dec 1, 2022
bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Dec 7, 2022
nodejs-github-bot pushed a commit that referenced this issue Dec 11, 2022
Fixes: #45380
PR-URL: #45698
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
ErickWendel pushed a commit to ErickWendel/node that referenced this issue Dec 12, 2022
Fixes: nodejs#45380
PR-URL: nodejs#45698
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
targos pushed a commit that referenced this issue Dec 12, 2022
Fixes: #45380
PR-URL: #45698
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
targos pushed a commit that referenced this issue Dec 13, 2022
Fixes: #45380
PR-URL: #45698
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
danielleadams pushed a commit that referenced this issue Dec 30, 2022
Fixes: #45380
PR-URL: #45698
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
danielleadams pushed a commit that referenced this issue Dec 30, 2022
Fixes: #45380
PR-URL: #45698
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
danielleadams pushed a commit that referenced this issue Jan 3, 2023
Fixes: #45380
PR-URL: #45698
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
danielleadams pushed a commit that referenced this issue Jan 4, 2023
Fixes: #45380
PR-URL: #45698
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
danielleadams pushed a commit that referenced this issue Jan 5, 2023
Fixes: #45380
PR-URL: #45698
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
3 participants