Hello, how to turn off these annoying warnings on build with Hermes enabled?
I have some JSON files where I put translations there, and a LOT of warnings prompts on build, I thought was react-native loop issue but is just log from Hermes.
warning: The first definition was here.
What is the entire text of the warning?
What is the entire text of the warning?
@tmikov It prompts a chunk of minified code from index.android.bundle and shows warnings like ones in hermes file diagnode_errors.js for example:
//CHECK:{{.*}}warning: the property "color" was set multiple times in the object definition.
//CHECK-NEXT:var x = { color: 10, color: 20 };
//CHECK-NEXT: ^~
//CHECK-NEXT:{{.*}} warning: The first definition was here.
//CHECK-NEXT:var x = { color: 10, color: 20 };
//CHECK-NEXT: ^~~~~~~~~
It is some similar warnings to https://github.com/facebook/react-native/issues/25599#issuecomment-510911486
Looks like these are legitimate warnings - the same property is being declared multiple times. I am curious - why is that desirable?
If you want to ignore them, you can pass the "-w" command line option to Hermes - it disables all warnings.
Looks like these are legitimate warnings - the same property is being declared multiple times. I am curious - why is that desirable?
If you want to ignore them, you can pass the "-w" command-line option to Hermes - it disables all warnings.
@tmikov, is because of I18n that I use consumes JSON, and as there is a term per language, when it bundles Hermes complains about that, that's why.
Do you know where I can put this command in React Native build process?
@iagormoraes RN runs the hermes compiler here: https://github.com/facebook/react-native/blob/992e0ce922cee91b079f8da7ce0e03ee2780b8c8/react.gradle#L189-L193
That's RN master, but whatever release you have should be similar.
In your project.ext.react you can add hermesFlagsRelease: ["-w"]
It worked guys, thank you so much!
Most helpful comment
In your
project.ext.reactyou can addhermesFlagsRelease: ["-w"]