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

What happens with process object in Internal realm.js file? #4425

Closed
2 tasks done
jdiaz-dev opened this issue Jun 25, 2024 · 4 comments
Closed
2 tasks done

What happens with process object in Internal realm.js file? #4425

jdiaz-dev opened this issue Jun 25, 2024 · 4 comments

Comments

@jdiaz-dev
Copy link

Node.js Version

v23.0.0-pre

NPM Version

not apply

Operating System

not apply

Subsystem

Other

Description

I am trying to collaborate with node.js internals. I found the realm.js file and I tried to realize a print using process.stdout.write() method but launched an error at moment to compile:

I would like to know why process object is different in realm.js file compared with another normal .js file?

Minimal Reproduction

write process.stdout.write() in any code line in internal realm.js file

Output

TypeError: Cannot read properties of undefined (reading 'write')
at internalBinding (node:internal/bootstrap/realm:185:20)
at node:internal/bootstrap/realm:191:3

Before You Submit

  • I have looked for issues that already exist before submitting this
  • My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask
@RedYetiDev
Copy link
Member

These are the files that create the process object. The stdout property hasn't been created yet.

@RedYetiDev
Copy link
Member

See the snippet below:

https://github.com/nodejs/node/blob/8e33f20a64fedf234aa6e48a82fdfdb2928a541a/lib/internal/bootstrap/switches/is_main_thread.js#L153

@jdiaz-dev
Copy link
Author

What is the alternative to realize a print or a console in this file?

@RedYetiDev
Copy link
Member

I'm not sure, sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants