Skip to content

Duplicate __self prop found error on app launch #1891

@jaeho-jinju

Description

@jaeho-jinju

Description

When launching a React Native app through Radon IDE, the following error screen appears during initial launch, blocking the app from running:

Duplicate __self prop found. You are most likely using the deprecated transform-react-jsx-self Babel plugin. 
Both __source and __self are automatically set when using the automatic runtime. 
Please remove transform-react-jsx-source and transform-react-jsx-self from your Babel config.

This error does not appear when running the same project via Metro (yarn start).

Root Cause

@react-native/babel-preset registers both:

  1. @babel/plugin-transform-react-jsx with { runtime: 'automatic' } — which automatically injects __self and __source
  2. @babel/plugin-transform-react-jsx-self and @babel/plugin-transform-react-jsx-source in dev mode — which inject __self and __source again

This causes duplicate __self props. Metro suppresses this internally, but Radon IDE's bundler treats it as an error.

Relevant code in @react-native/babel-preset/src/configs/main.js:

// Line 54-58: automatic runtime (already handles __self/__source)
if (!options.useTransformReactJSXExperimental) {
  extraPlugins.push([
    require('@babel/plugin-transform-react-jsx'),
    {runtime: 'automatic'},
  ]);
}

// Line 174-177: duplicates __self/__source in dev mode
if (options && options.dev && !options.useTransformReactJSXExperimental) {
  extraPlugins.push([require('@babel/plugin-transform-react-jsx-source')]);
  extraPlugins.push([require('@babel/plugin-transform-react-jsx-self')]);
}

Workaround

Setting useTransformReactJSXExperimental: true in babel.config.js and manually adding the JSX transform plugin resolves the error, but this requires users to modify their Babel config:

presets: [
  ["module:@react-native/babel-preset", { useTransformReactJSXExperimental: true }],
],
plugins: [
  ["@babel/plugin-transform-react-jsx", { runtime: "automatic" }],
],

Environment

  • Radon IDE version: 1.15.1
  • Editor: Cursor (VSCode)
  • React Native version: 0.79.6
  • Platform: macOS (Apple Silicon)

Expected Behavior

The error should not appear. Metro bundler does not show this error with the same Babel config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclose when staleThis issue is going to be closed when there is no activity for a while

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions