-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
transform.forEach is not a function #13765
Comments
I am also getting this issue, even with Hello World sample project. |
Yes, here too. I've updated to the latest everything and still can't get a newly created project to run without that error. Even after attempting to update everything and/or nuking and re-installing everything including node modules. running latest OS X / Xcode / node (6.10.3) / npm / react / react-native-cli / etc UPDATE: Just now I used a different project name but did the exact same steps... and it worked. That's just messed up. |
For me, it is still failing for same reason. I even tried a new name. |
I found a solution for myself yesterday. I tried to reinstall new node by command 'brew install node', and the problem get solved. |
Im getting this problem too.. Already updated the node and changed the name of project. EDITED: |
I'm having this issue as well. It seems inconsistent; some newly initialized projects work and some give this message. |
I have tried creating new projects. Issue still exists. All the components are installed and no build errors. What am I doing wrong? I'm new to react native. |
After creating multiple projects with no success my workaround is to downgrade React Native until the issue is fixed. |
Update everything (brew update, npm update), uninstall node, watchman and react-native-cli and do a clean install again. https://facebook.github.io/react-native/docs/getting-started.html That worked for me |
I also have this problem, so far i found no solution. Following the issue. |
I reinstalled as @AnselmMarie suggested, AND I also changed the project name. It's working for me now. |
I was also getting this problem trying to run the sample app here https://facebook.github.io/react-native/docs/getting-started.html I finally got it to work on my Android by downgrading my React Native version to 0.43.4 |
I'm having the same error here on macOS Sierra. Node version 4.6.1 |
I am having the same problem on Windows, any solution will be greatly appreciated... |
Seems it's a problem with Node 4.x |
thanks @terryttsai , your idea worked and awesome ! |
@sunnylqm Node is now updated to 6.10.3 and the error is still present. |
same problem on osx |
I was also on node 6.x, which I'm pretty sure I installed from nodejs.org website. I reinstalled node using Running Sure enough, the problem is solved for me. |
@bdgeyter thanks, I uninstalled and reinstalled node using |
Tried a bunch of solutions here. Falling back to an earlier version did the trick for me. Thanks @AnselmMarie ! |
I have the same error. |
Having this same error. node v7.10.0 Can't get it to work from a clean install. |
We recently added Lottie and Firebase Analytics to our RN project and then I saw this error. Tried reinstalling node/npm version (7.10.0), yarn (0.24.5), watchman (4.7.0), etc. And still had this error. I tried a clean checkout of our project, removing the Pods/ folder, removing node_modules and reinstalling. Also tried resetting iOS simulator. Nothing worked. Then I tried actually debugging the issue by inserting I can't say exactly what caused the change. Co-worker didn't have this issue. Seemed to have exactly the same setup. Doing changes in the project installation of RN with hot module reloading caused an error (too many components being reloaded) so perhaps something got recompiled along the way. It's odd since I've removed and reinstalled node_modules so many times. I'd suggest others who encounter this issue to try something similar. |
I had this same problem. I fixed it by updating to the latest node(7.10.0 at the time of writing this), then I completely torched the boilerplate project, rebuilt it, and it compiled without a problem. |
0.44 is crap.. 0.43.4 works.. react-native init --version 0.43.4 AwesomeProject |
react-native 0.43.4 works and 0.44,0.46 cannot work.
|
I believe this is due to some Haste/Node packaging nondeterminism bug, that is causing the code to use the top-level npm module It's manifesting because the Style validator was being passed as the
Digging in, I believe this is a result of module packager getting confused with In particular, Unfortunately, in cases where things are broken (ie, all of us above), it appears to import a top-level node module called Unfortunately, I am still not clear what causes the react-native package to import one I've just filed an issue on the |
(Updated: with hopefully-improved fix instructions)
If you're curious for a deeper history as to all the above confusion, read on for my guess at a fuller explanation as to why this bug was hard to fix (though still no understanding of how the cache got corrupted):
As stated above, React-Native was installing a In the meantime, you can install
Unfortunately, there is some cached state stored in the This cache stores full paths to files, which might also explains why any change to the directory paths will avoid the corrupted cache entries and fix things: changing the project name, creating a new project, or checking out a new directory. (But notably, deleting the current directory and recreating it in-place won't fix things.) The cache files (on Mac) appear to be stored in /var/folders/, which I think will be erased when you reboot the OS. This may explain why other people's problems "randomly" went away. It appears to try to "update the cache" in response to changed files, which might be mtime dependent. Refetching from NPM would pull in the same timestamps on the actual js files (such as Oh, and I wish I could have those 7 hours of my life back. |
@mikelambert resetting the cache still doesn't solve this issue for me. |
Ugh sorry. :( Talking a bit more on facebook/metro#18, I think I realized my diagnosis was half-wrong, and my proposed solution was incomplete. I would delete I've just updated my above post to reflect this better fix...sorry for making your comment look out of place now. |
So, I don't really know if this will work for someone else, but I ran npm install prop-types and it stopped showing this error and working again. |
I've tried all of these steps, still getting |
for anyone else getting this error, my problem was in my code: WRONG
RIGHT
make sure you wrap your transform in an array!!! |
tried all of this step, nothing works, same error, same frustration |
This helped us.
|
using yarn instead of npm did the job for me, worked out of the box! |
Just a headsup, there is a new version of So if you are still having issues, I would try to find |
@alinakgh i removed node_modules dir and install with yarn and works for me, thank you a lot!! |
After spend a half day of struggling, just reboot my mac and worked. Inspired by
Thanks @mikelambert |
I got the same problem but I solved it in this way: this works for me. Please Try! |
I got the same problem; I tried several of the ideas mentioned above but still could not make it work, then I tried building it with |
I had other conflicts too in my project (apart from 'node_modules/react-native/node_modules/merge'), nevertheless, @mikelambert 's solution of resolving just this conflict (rm -rf node_modules/react-native/node_modules/merge) still worked for me. Thanx dude! |
@GianniGM work for me. thx |
After trying everything. I tried restarting MacOS, and it works for me!
|
s.tantoncbradley's solution worked for me: #13765 (comment). The issue was setting I feel like RN should have a type-check here and throw a better error message... |
@mikelambert worked for me, except I had to use |
@stantoncbradley thanks a lot my animation is working!! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
@mikelambert your solution work, thank mate! |
I got the following error in the simulator when running a newly created project without updating react native cli:
transform.forEach is not a function
I had node version 4.7.1. The problem happens on both iOS and Android
I updated node to latest version and updated RN cli and created a new app and it worked fine but the one created before still gives the same error even after deleting and reinstalling node modules using npm install
The text was updated successfully, but these errors were encountered: