Skip to content

SyntaxError: Unexpected token '}'. Expected a statement as the body of a for loop. #3763

@oney

Description

@oney

I run react-native init TestProject to create a project, then I run the app with iOS and it works fine.
I add socket.io-client in my dependencies, and run npm install.

"dependencies": {
  "react-native": "^0.13.2",
  "socket.io-client": "^1.3.7"
}

And add

window.navigator.userAgent = "react-native";
var io = require('socket.io-client/socket.io');

var TestProject = React.createClass({
...

I got

SyntaxError: Unexpected token '}'. Expected a statement as the body of a for loop.

image
I use socket.io before, and it works. However, every my React Native project that uses socket.io is broken now. So strange...
Line 60582 of http://localhost:8081/index.ios.bundle?platform=ios&dev=true is

for(length = members.length;property = members[--length];hasProperty.call(object,property) && callback(property))}}else 

It seems that many ; symbol is gone in my js bundle file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions