Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

TypeError: o is not a function. (In 'o()', 'o' is undefined) #768

@noway

Description

@noway

Encountering this error straight after Getting Started installation. No connections are going through, I don't see my device in Reactotron Mac App:
IMG_9E9138262D87-1

TypeError: o is not a function. (In 'o()', 'o' is undefined)
r
    index.js:1:13042
d
    index.js:1:13222
EventTarget.prototype.dispatchEvent
    event-target-shim.js:818:39
_setReadyState
    FileReader.js:80:25
NativeFileReaderModule.readAsText.then$argument_0
    FileReader.js:118:28
tryCallOne
    core.js:37:14
setImmediate$argument_0
    core.js:123:25

reactotron config:

import Reactotron from 'reactotron-react-native'
import AsyncStorage from '@react-native-community/async-storage'

Reactotron
  .setAsyncStorageHandler(AsyncStorage) // AsyncStorage would either come from `react-native` or `@react-native-community/async-storage` depending on where you get it from
  .configure({
    name: "React Native Demo"
  }) // controls connection & communication settings
  .useReactNative() // add all built-in react native plugins
  .connect() // let's connect!

App.tsx:

if(__DEV__) {
  import('./ReactotronConfig').then(() => console.log('Reactotron Configured'))
}
import React from 'react'
import { StatusBar, Platform } from 'react-native'
// ... etc

react native info:

warn Your project is using deprecated "rnpm" config that will stop working from next release. Please use a "react-native.config.js" file to configure the React Native CLI. Migration guide: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - react-native-comparison-slider: https://npmjs.com/package/react-native-comparison-slider
  - react-native-fetch-blob: https://npmjs.com/package/react-native-fetch-blob
  - react-native-music-control: https://npmjs.com/package/react-native-music-control
  - react-native-orientation: https://github.com/yamill/react-native-orientation#readme
  - react-native-vector-icons: https://github.com/oblador/react-native-vector-icons
  - react-native-video: https://npmjs.com/package/react-native-video
  - react-native-zip-archive: https://github.com/mockingbot/react-native-zip-archive
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
info Fetching system and libraries information...
System:
    OS: macOS 11.2.2
    CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
    Memory: 157.16 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.7.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6308749
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.5 => 0.61.5

This is the minified snippet of where the error happens. I don't know where that relates to the unminified code, pretty hard to debug a minified version.

            function d(a, c, d, e, g, i) {
                if (!i._skipReactotron) {
                    var j = null,
                        k = e ? e.indexOf("?") : -1; - 1 < k && (j = queryString.parse(e.substr(k)));
                    var l = i._trackingName,
                        m = h[l] || {};
                    h[l] = null;
                    var n = m.data,
                        o = m.stopTimer,
                        p = {
                            url: e || m.xhr._url,
                            method: i._method || null,
                            data: n,
                            headers: i._headers || null,
                            params: j
                        },
                        q = i.responseHeaders && i.responseHeaders["content-type"] || i.responseHeaders && i.responseHeaders["Content-Type"] || "",
                        r = function(c) {
                            var e = "~~~ skipped ~~~";
                            if (c) try {
                                e = JSON.parse(c)
                            } catch (a) {
                                e = d
                            }
                            var f = {
                                body: e,
                                status: a,
                                headers: i.responseHeaders || null
                            };
                            b.apiResponse(p, f, o())
                        },
                        s = ("string" == typeof d || "object" === _typeof(d)) && !f.test(q || "");
                    if (!s) r("");
                    else if ("blob" === g && "undefined" != typeof FileReader && d) {
                        var t = new FileReader,
                            u = function a() {
                                r(t.result), t.removeEventListener("loadend", a)
                            };
                        t.addEventListener("loadend", u), t.readAsText(d)
                    } else r(d)
                }
            }

This is where the error is coming from: https://github.com/infinitered/reactotron-react-native/blob/master/src/plugins/networking.ts#L115

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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