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

Property 'console' doesn't exist #675

Closed
1 task
gxanshu opened this issue Feb 16, 2022 · 4 comments
Closed
1 task

Property 'console' doesn't exist #675

gxanshu opened this issue Feb 16, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@gxanshu
Copy link

gxanshu commented Feb 16, 2022

Bug Description

  • I have run gradle clean and confirmed this bug does not occur with JSC

Hermes version: 0.11.0
React Native version (if any):
OS version (if any): zorin os 16 lite (based on ubuntu 20.04)
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): x86_64

Steps To Reproduce

  1. just build hermes from the repo
  2. test hermes command with some javascript code

code example:
console.log("Hemes works!");

The Expected Behavior

Hermes Works

Screenshot

Screenshot_2022-02-16_05-45-18

@gxanshu gxanshu added the bug Something isn't working label Feb 16, 2022
@neildhar
Copy link
Contributor

Hi @aianshume, console is not a built-in in JavaScript. Hermes does not provide a console.log function, it is provided by React Native or any other Hermes integrator.

If you'd like to run the Hermes executable directly, you should be able to use the print function to print things to the console.

@gxanshu
Copy link
Author

gxanshu commented Feb 16, 2022

Hi @aianshume, console is not a built-in in JavaScript. Hermes does not provide a console.log function, it is provided by React Native or any other Hermes integrator.

If you'd like to run the Hermes executable directly, you should be able to use the print function to print things to the console.

nice one thank you

@melroy89
Copy link

That is funny, since JS/TS runtimes like Node.js or Bun do know about console.

I believe Herman should create a simple wrapper, so all console.* calls will become print()

@tmikov
Copy link
Contributor

tmikov commented Apr 19, 2024

@melroy89 absolutely, runtimes should provide an implementation of console. However Hermes is not a runtime like NodeJS or a Bun, it is a JS engine like v8 or JSC.

It would be convenient to add an implementation of console to the hermes tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@melroy89 @neildhar @tmikov @gxanshu and others