Ui: can't resolve Parallax.js

Created on 27 Nov 2016  路  6Comments  路  Source: shoutem/ui

Finally I complete install shoutem (many errors occurred...), however when i execute react-native run-ios, i met 2 errors.

First:

SyntaxError /User/projectpath/node_modules/@shoutem/ui/theme.js: Unexpected token (885:22)

So I fix this (by just remove specific code from theme.js), second one has bee occurred.

Unable to resoleve module react/lib/NativeMethodsMixin from /Users/projectpath/node_modules/@shoutem/amination/Parallax.js: Module does not exist in the module map or in these directories: 
 /Users/projectpath/node_modules/react/lib

I tried this with

  • OSX sierra
  • xcode 8.1
  • react-native 0.38

And error message also mentioned that

  1. clear watchman watches
  2. delete the node_modules
  3. reset packager cache

but that didn't solve this issue. Does anyone face this issue?

Most helpful comment

I also had this issue and managed to fix it.

Since React 15.4.0 React moved the renderers to their individual npm packages.
See here
So NativeMethodsMixin was moved from the React package to the React Native package.

All you have to do is change one line of code in node_modules/@shoutem/animation/Parallex.js

Remove line 2:
import NativeMethodsMixin from 'react/lib/NativeMethodsMixin';

And edit the react-native import to this:
import { Animated, View, Dimensions, NativeMethodsMixin } from 'react-native';

This resolved the issue for me.

I will file an issue at the animation github repo it uses.

All 6 comments

I also had this issue and managed to fix it.

Since React 15.4.0 React moved the renderers to their individual npm packages.
See here
So NativeMethodsMixin was moved from the React package to the React Native package.

All you have to do is change one line of code in node_modules/@shoutem/animation/Parallex.js

Remove line 2:
import NativeMethodsMixin from 'react/lib/NativeMethodsMixin';

And edit the react-native import to this:
import { Animated, View, Dimensions, NativeMethodsMixin } from 'react-native';

This resolved the issue for me.

I will file an issue at the animation github repo it uses.

thank you for posting the fix, worked fine for me too.

i think the Shoutem folks should get this sorted asap as anyone new / trying out the toolkit (via latest react-native init ..) will just see a red screen / broken build.

Hey guys! Thank you with this one, we have fixed syntax error introduced with this #80 pull request. I will address issue with Parallax on animation repo today!

Thank you one more time, you are helping us a lot!

Thanks @TimIJpenga , it works!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lxwbr picture lxwbr  路  4Comments

JulianKingman picture JulianKingman  路  4Comments

kreshnikalidema picture kreshnikalidema  路  5Comments

arudrakalyan picture arudrakalyan  路  9Comments

aessig picture aessig  路  6Comments