Skip to content

React Native (JavaScriptCore) Incompatibility - "Conflicting definitions of %InertAsyncFunction%" #659

@EtDu

Description

@EtDu

Solved: SES was being broken by a transformation #659 (comment)

When importing and calling lockdown() in a React Native context, the following error appears:
Screen Shot 2021-04-08 at 11 42 51 AM

entry index.js file

import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
import './lockdown.umd.js'

lockdown({ errorTaming: 'unsafe'})

AppRegistry.registerComponent(appName, () => App);

ELI5 React Native Setup:

yarn install -g expo-cli
expo init LockdownBug
cd LockdownBug

Add lockdown.umd.js in the project root
Then, inside index.js:

import { registerRootComponent } from 'expo';

import App from './App';
import './lockdown.umd'
lockdown({errorTaming: 'unsafe'})

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in the Expo client or in a native build,
// the environment is set up appropriately
registerRootComponent(App);

Finally,

yarn web

This opens a debugging tab with the error present!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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