Skip to content

Requiring module 'NativeModules' by name - arguments[0].indexOf is undefined #14364

@ben-snaize

Description

@ben-snaize

Hi,

Seeing an odd issue in RN 0.42 (since upgrading from 0.38, I believe).

I can't replicate the crash locally in debug or release which makes things difficult, but on both iOS and Android I'm seeing the following logged from Crashlytics. Both apps run through flawlessly locally, on device and via TestFlight / Play Store beta, yet something like like 1 in 20 users of the live Apps are crashing due to this:

RCTFatalException: Unhandled JS Exception: arguments[0].indexOf is not a function. (In 'arguments[0].indexOf("Requiring module 'NativeModules' by name")', 'arguments[0].indexOf' is undefined)

This seems to be stemming from here in index.[os].bundle.js where arguments[0].indexOf is called.

console.warn = function () {
    if (arguments[0] && arguments[0].indexOf('Requiring module \'NativeModules\' by name') > -1) return;
    return originalWarn.apply(console, arguments);
};

Does anyone have an idea of what could the cause of this? Why would arguments[0].indexOf be undefined at this stage?

I know the crash is very context dependent but some sort of pointer would be of great help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions