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

transform.forEach is not a function. (In 'transform.forEach', 'transform.forEach' is undefined) #14648

Closed
iwangx opened this issue Jun 21, 2017 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@iwangx
Copy link

iwangx commented Jun 21, 2017

Description

When prompted to start "transform.forEach is not a function".Log as shown below.

2017-06-21 10:43:59.220 [error][tid:com.facebook.React.JavaScript] transform.forEach is not a function. (In 'transform.forEach', 'transform.forEach' is undefined)
2017-06-21 10:43:59.224 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: transform.forEach is not a function. (In 'transform.forEach', 'transform.forEach' is undefined)

Reproduction Steps

react-native start

Sample Code

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View
} from 'react-native';

export default class HelloWorld extends Component {
    render() {
        return (
            <View style={styles.container}>
              <Text style={styles.welcome}>
                Welcome to React Native!
              </Text>
              <Text style={styles.instructions}>
                To get started, edit index.ios.js
              </Text>
              <Text style={styles.instructions}>
                Press Cmd+R to reload,{'\n'}
                Cmd+D or shake for dev menu
              </Text>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#F5FCFF',
    },
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
    },
    instructions: {
        textAlign: 'center',
        color: '#333333',
        marginBottom: 5,
    },
});

AppRegistry.registerComponent('HelloWorld', () => HelloWorld);

Solution

The 119 line in the following file, transform, may be a variable of type bool

/node_modules/react-native/Libraries/StyleSheet/processTransform.js

Additional Information

  • React Native version:"react": "16.0.0-alpha.12", "react-native": "0.45.1"
  • Platform: iOS
  • Development Operating System: macOS
  • Build tools: Xcode
@mikelambert
Copy link
Contributor

mikelambert commented Jul 3, 2017

Looks like a dupe of #13765. Posted a fix in #13765 (comment)

@iwangx
Copy link
Author

iwangx commented Jul 11, 2017

@mikelambert
I solved the problem by installing the application using yarn

npm install -g yarn react-native-cli
yarn install

@iwangx iwangx closed this as completed Jul 11, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Jul 11, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants