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

media-queries.js file throws error when ran on Android #14

Closed
PimDeWitte opened this issue Jun 8, 2016 · 5 comments
Closed

media-queries.js file throws error when ran on Android #14

PimDeWitte opened this issue Jun 8, 2016 · 5 comments

Comments

@PimDeWitte
Copy link

PimDeWitte commented Jun 8, 2016

So the library works great on iOS, but when I try to run the same library on Android, I receive the following error on startup.

screen shot 2016-06-07 at 4 58 15 pm

It's on this line: const res = Object.keys(obj).reduce((res, key) => {

I've read up on the other issues and it looks like Android is not setting these properties correctly. Can you please advise?

My code:

screen shot 2016-06-07 at 5 01 49 pm

@PimDeWitte
Copy link
Author

When removing the .build() function, it works fine, except obviously the EStyleSheets don't work, but the rest of the app functions fine. Should I call it at some other location in the app?

@PimDeWitte
Copy link
Author

PimDeWitte commented Jun 8, 2016

Fixed it by adding a length check to the process(obj) function. Put this under function process(obj)

if(obj === undefined || obj.length <= 0) { return null; }

@PimDeWitte
Copy link
Author

PimDeWitte commented Jun 8, 2016

Fixed in #15. Please merge.

@PimDeWitte PimDeWitte reopened this Jun 8, 2016
@PimDeWitte
Copy link
Author

Reopned because issue is not fixed. I'm not sure why - but the error has returned even with the null checks.
screen shot 2016-06-08 at 10 22 36 am

@vitalets
Copy link
Owner

hi @PimDeWitte

could you show the object that you pass to EStyleSheet.create() ?

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

No branches or pull requests

2 participants