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

index.ios.js running twice #79

Closed
jacobrosenthal opened this issue Sep 22, 2015 · 6 comments
Closed

index.ios.js running twice #79

jacobrosenthal opened this issue Sep 22, 2015 · 6 comments

Comments

@jacobrosenthal
Copy link

react pacakger open, port 8081 selected

2015-09-22 15:32:09.929 [info][tid:com.facebook.React.JavaScript] 'something'
2015-09-22 15:32:09.982 [info][tid:com.facebook.React.JavaScript] 'Running application "bleqr" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF'
2015-09-22 15:32:10.029 [warn][tid:com.facebook.React.JavaScript] 'devtools socket errored', [Error: The operation couldn’t be completed. Connection refused]

webpackager open, port 8080 selected

2015-09-22 15:33:08.769 [info][tid:com.facebook.React.JavaScript] 'something'
2015-09-22 15:33:08.781 [info][tid:com.facebook.React.JavaScript] 'something'
2015-09-22 15:33:08.819 [info][tid:com.facebook.React.JavaScript] 'Running application "bleqr" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF'
2015-09-22 15:33:08.865 [warn][tid:com.facebook.React.JavaScript] 'devtools socket errored', [Error: The operation couldn’t be completed. Connection refused]

index.ios.js

'use strict';

var React = require('react-native');

console.log('something');

var {
  AppRegistry,
  Text,
  View
} = React;

var async = require('async');

var bleqr = React.createClass({

  render: function() {
    return (
      <View>
      </View>
    );
  },

});

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

Probably related to what Im seeing on #75 where it loads successfully and also crashes.

@elliottsj
Copy link
Collaborator

What does your webpack config look like?

@jacobrosenthal
Copy link
Author

var path = require('path');
var webpack = require('webpack');

module.exports = {
  debug: true,
  devtool: 'source-map',
  watch: true,
  entry: {
    'index.ios': ['./index.ios.js'],
    'index.android': ['./index.android.js'],
  },
  output: {
    path: path.resolve(__dirname, 'build'),
    filename: '[name].js',
  },
  module: {
    loaders: [
      {
        test: /\.(js|jsx|es6)$/,
        exclude: /node_modules/,
        loaders: ['babel-loader?optional=runtime']
      },
      {
        test: /\.js$/,
        include: /node_modules\/react-native-video/,
        loaders: ['babel-loader?optional=es7.objectRestSpread']
      },
      {
        test: /\.js$/,
        include: /node_modules\/react-native-localization/,
        loaders: ['babel-loader?optional=runtime']
      }
    ]
  },
  resolve: { extensions: ['', '.js', '.jsx', '.es6'] },
  plugins: [
    new webpack.NoErrorsPlugin(),
  ],
};

@elliottsj
Copy link
Collaborator

Hm, I see you have index.android. Were you able to get Android up and running? I suspect the error devtools socket errored is due to the same issue here: #65 (comment)

Not sure why index.ios.js would run twice though; where does this console output appear?

2015-09-22 15:32:09.929 [info][tid:com.facebook.React.JavaScript] 'something'
2015-09-22 15:32:09.982 [info][tid:com.facebook.React.JavaScript] 'Running application "bleqr" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF'
2015-09-22 15:32:10.029 [warn][tid:com.facebook.React.JavaScript] 'devtools socket errored', [Error: The operation couldn’t be completed. Connection refused]
2015-09-22 15:33:08.769 [info][tid:com.facebook.React.JavaScript] 'something'
2015-09-22 15:33:08.781 [info][tid:com.facebook.React.JavaScript] 'something'
2015-09-22 15:33:08.819 [info][tid:com.facebook.React.JavaScript] 'Running application "bleqr" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF'
2015-09-22 15:33:08.865 [warn][tid:com.facebook.React.JavaScript] 'devtools socket errored', [Error: The operation couldn’t be completed. Connection refused]

In the chrome dev tools?

@jacobrosenthal
Copy link
Author

Im not doing any android, I just I cribbed my config from https://github.com/jhabdas/react-native-webpack-starter-kit which had that line.

Output is from xcode console.

@elliottsj
Copy link
Collaborator

@jacobrosenthal Were you able to resolve this error?

@elliottsj
Copy link
Collaborator

Closing stale issue

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