Skip to content

Object prototype may only be an Object or null #6

@deblasis

Description

@deblasis

Hi, I am getting this on Windows + Android

image

Reproducible by doing the following:

  1. react-native init randombytestest
  2. npm install -g rn-nodeify
  3. npm install react-native-randombytes --save
  4. react-native link
  5. npm install install react-native-jwt --save
  6. rn-nodeify --install --hack
  7. then this is a hacky test index.android.js:
import './shim'

import jwt from 'react-native-jwt';

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

export default class randombytestest extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          Welcome to React Native!
          {jwt.encode('aaaa','aaaa')}
        </Text>
        <Text style={styles.instructions}>
          To get started, edit index.android.js
        </Text>
        <Text style={styles.instructions}>
          Double tap R on your keyboard to reload,{'\n'}
          Shake or press menu button 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('randombytestest', () => randombytestest);

any clues?

package.json:


{
  "name": "randombytestest",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "assert": "^1.1.1",
    "browserify-zlib": "^0.1.4",
    "buffer": "^3.0.3",
    "console-browserify": "^1.1.0",
    "constants-browserify": "0.0.1",
    "dns.js": "^1.0.1",
    "domain-browser": "^1.1.1",
    "events": "^1.0.0",
    "https-browserify": "0.0.1",
    "os-browserify": "^0.1.2",
    "path-browserify": "0.0.0",
    "process": "^0.11.0",
    "querystring-es3": "^0.2.1",
    "react": "16.0.0-alpha.12",
    "react-native": "0.46.4",
    "react-native-http": "github:tradle/react-native-http#834492d",
    "react-native-jwt": "^1.0.0",
    "react-native-level-fs": "^3.0.0",
    "react-native-randombytes": "^2.2.0",
    "react-native-tcp": "^2.0.4",
    "react-native-udp": "^1.2.0",
    "readable-stream": "^1.0.33",
    "stream-browserify": "^1.0.0",
    "string_decoder": "^0.10.31",
    "timers-browserify": "^1.0.1",
    "tty-browserify": "0.0.0",
    "url": "^0.10.3",
    "util": "^0.10.3",
    "vm-browserify": "0.0.4"
  },
  "devDependencies": {
    "babel-jest": "20.0.3",
    "babel-preset-react-native": "2.1.0",
    "jest": "20.0.4",
    "react-test-renderer": "16.0.0-alpha.12"
  },
  "jest": {
    "preset": "react-native"
  },
  "react-native": {
    "zlib": "browserify-zlib",
    "console": "console-browserify",
    "constants": "constants-browserify",
    "crypto": "react-native-crypto",
    "dns": "dns.js",
    "net": "react-native-tcp",
    "domain": "domain-browser",
    "http": "react-native-http",
    "https": "https-browserify",
    "os": "os-browserify",
    "path": "path-browserify",
    "querystring": "querystring-es3",
    "fs": "react-native-level-fs",
    "_stream_transform": "readable-stream/transform",
    "_stream_readable": "readable-stream/readable",
    "_stream_writable": "readable-stream/writable",
    "_stream_duplex": "readable-stream/duplex",
    "_stream_passthrough": "readable-stream/passthrough",
    "dgram": "react-native-udp",
    "stream": "stream-browserify",
    "timers": "timers-browserify",
    "tty": "tty-browserify",
    "vm": "vm-browserify"
  },
  "browser": {
    "zlib": "browserify-zlib",
    "console": "console-browserify",
    "constants": "constants-browserify",
    "crypto": "react-native-crypto",
    "dns": "dns.js",
    "net": "react-native-tcp",
    "domain": "domain-browser",
    "http": "react-native-http",
    "https": "https-browserify",
    "os": "os-browserify",
    "path": "path-browserify",
    "querystring": "querystring-es3",
    "fs": "react-native-level-fs",
    "_stream_transform": "readable-stream/transform",
    "_stream_readable": "readable-stream/readable",
    "_stream_writable": "readable-stream/writable",
    "_stream_duplex": "readable-stream/duplex",
    "_stream_passthrough": "readable-stream/passthrough",
    "dgram": "react-native-udp",
    "stream": "stream-browserify",
    "timers": "timers-browserify",
    "tty": "tty-browserify",
    "vm": "vm-browserify"
  }
}

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions