Error "No identifiers allowed directly after numeric literal" in some environments #223
pcprinz posted onGitHub
I recently created a npm package that uses color version 4.0.1. More specifically, I am using the Color(string)
constructor and the red()
, green()
and blue()
methods.
That's all:
const rgb = Color(color);
...
Math.round(rgb.red()),
Math.round(rgb.green()),
Math.round(rgb.blue())
If I use my package in a pure Javascript environment, or in a compiled Typescript app, then I have no problems. However, when I include my package in a React Native project, I get this error:
No identifiers allowed directly after numeric literal
No identifiers allowed directly after numeric literal
no stack
no stack
It took me hours to find that downgrading Color back to version <4 will fix this problem. So far, however, I have not been able to find out what exactly is causing the error, since, as you can see, no stack exists either. The following issue brought me to solving the problem and the connection with Color: https://github.com/polkadot-js/ui/issues/516