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

process.config is not cloneable anymore in v16.x #43581

Closed
bnoordhuis opened this issue Jun 26, 2022 · 2 comments · Fixed by #43627
Closed

process.config is not cloneable anymore in v16.x #43581

bnoordhuis opened this issue Jun 26, 2022 · 2 comments · Fixed by #43627
Labels
process Issues and PRs related to the process subsystem.

Comments

@bnoordhuis
Copy link
Member

bnoordhuis commented Jun 26, 2022

v16.0.0 / process

#36902 made process.config immutable. That's fine in principle but the use of a Proxy breaks the following code:

v8.serialize(process.config) // Uncaught Error: #<Object> could not be cloned.

The properties themselves are proxies too so Object.fromEntries(Object.entries(process.config)) is not an easy workaround.

I suggest using Object.freeze() or Object.seal() instead.

cc @jasnell

@bnoordhuis bnoordhuis added the process Issues and PRs related to the process subsystem. label Jun 26, 2022
@legendecas
Copy link
Member

We cannot intercept modifications on frozen or sealed objects and print warnings about that. That seems to be the key point of runtime deprecation.

@targos
Copy link
Member

targos commented Jun 27, 2022

The deprecation is here since v16.0.0. I think it should be fine to make it eol and lock the object in v19.0.0

gribnoysup added a commit to gribnoysup/node that referenced this issue Jul 1, 2022
gribnoysup added a commit to gribnoysup/node that referenced this issue Sep 9, 2022
nodejs-github-bot pushed a commit that referenced this issue Sep 10, 2022
Fixes: #43581
PR-URL: #43627
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Fyko pushed a commit to Fyko/node that referenced this issue Sep 15, 2022
Fixes: nodejs#43581
PR-URL: nodejs#43627
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants