Skip to content

Unable to resolve module react/jsx-runtime in low version of React

Open

Description

Describe the bug
I encounter react/jsx-runtime not found error when using the React version that doesn't support react/jsx-runtime. Is it possible to fix the issue by changing the compilerOptions.jsx from react-jsx to react/react-native?

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/lee1409/storybook-low-react
  2. npm install
  3. Run expo start --ios
  4. Open the expo go

Expected behavior
No error and bundle successful

Screenshots

iOS Bundling failed 2761ms
Unable to resolve module react/jsx-runtime from .../expo-app/my-app/node_modules/@storybook/addon-ondevice-actions/dist/index.js: react/jsx-runtime could not be found within the project.

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
   5 | Object.defineProperty(exports, "__esModule", { value: true });
   6 | exports.register = void 0;
>  7 | const jsx_runtime_1 = require("react/jsx-runtime");
     |                                ^
   8 | const addons_1 = __importDefault(require("@storybook/addons"));
   9 | const addon_actions_1 = require("@storybook/addon-actions");
  10 | const ActionLogger_1 = __importDefault(require("./containers/ActionLogger"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions