-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Exception Loading Root with JSON Descriptor containing Enums #964
Comments
That's strange, Enum.fromJSON should be there. What's the environment you are using protobuf.js in? Anything special? |
im using react native, |
I see. There have been similar issues in the past and iirc these are caused by recursive dependencies in the sources (enum.js requires something that again requires enum.js) that only react native isn't able to solve for some reason. This can be solved, usually, but requires checking all the dependencies and some reordering. Have you tried using the dist files instead? |
dist files work fine |
I'm seeing this as well (version 0.51.0 of react-native). The circular dependency arises when namespace.js requires enum.js and enum.js requires namespace.js. @dharmusharma1981 how were you able to import the dist files into the app? |
Downgrading to version 6.8.0 worked for me (I was on 6.8.3). |
for quick fix until PR merged:
(in essence 7 char diff from 6.8.6) |
@dcodeIO any plans to merge this PR? We are blocked from using protobufjs in React Native due to this issue. |
protobuf.js version: <6.8.3>
Exception ExceptionsManager.js:65 (intermediate value)(intermediate value)(intermediate value) is not a function ``` Im trying to load json file which contains enums ` "PlatformType": { "values": { "UNKNOWN": 0, "RAY_DESKTOP": 1, "RAY_MOBILE": 2 } },after drilling down the code
i find this Enum.fromJson is undefined in the libarary
```![screen shot 2017-12-21 at 2 30 46 pm](https://user-images.githubusercontent.com/10889920/34277738-e9c17c52-e65b-11e7-927a-a5addfcca539.png
The text was updated successfully, but these errors were encountered: