Skip to content

unable to resolve dependency tree in all circumstances. #827

Description

@switch-to-gitlab

Helllo,

This package is not installable as far as I can tell. I have tried the following ways:

Using the template

This is the command found on the website:

npx @react-native-community/cli init --template @rescript-react-native/template MyApp

This is the output of that command (under the emoji art)

✔ Downloading template
✔ Copying template
✔ Processing template
ℹ Executing post init script 
You are now ready to use ReScript React Native. Be sure to check the docs at https://rescript-react-native.github.io/
⠧ Installing dependencies

error An unexpected error occurred: Command failed with exit code 1: npm install
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: myapp@0.0.1
npm error Found: react@17.0.1
npm error node_modules/react
npm error   react@"17.0.1" from the root project
npm error   peer react@">=16.8.1" from @rescript/react@0.10.2
npm error   node_modules/@rescript/react
npm error     @rescript/react@"^0.10.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^19.0.0" from react-dom@19.0.0
npm error node_modules/react-dom
npm error   peer react-dom@">=16.8.1" from @rescript/react@0.10.2
npm error   node_modules/@rescript/react
npm error     @rescript/react@"^0.10.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/el/.npm/_logs/2025-02-01T02_24_34_831Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/el/.npm/_logs/2025-02-01T02_24_34_831Z-debug-0.log.

Installing the dependency itself even when no other dependencies are present

This command installs the package to a brand new node project and attempts to install rescript-react-native in a clean environment

mkdir MyApp && cd MyApp && npm init -y && npm i rescript-react-native

It fails with the same error but with slightly different numbers.

Wrote to /home/el/workbench/MyApp/package.json:

{
  "name": "myapp",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": ""
}



npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: myapp@1.0.0
npm error Found: react@19.0.0
npm error node_modules/react
npm error   peer react@">=18.0.0" from @rescript/react@0.13.0
npm error   node_modules/@rescript/react
npm error     peer @rescript/react@">=0.12.0" from rescript-react-native@0.75.0
npm error     node_modules/rescript-react-native
npm error       rescript-react-native@"*" from the root project
npm error   peer react@"^19.0.0" from react-dom@19.0.0
npm error   node_modules/react-dom
npm error     peer react-dom@">=18.0.0" from @rescript/react@0.13.0
npm error     node_modules/@rescript/react
npm error       peer @rescript/react@">=0.12.0" from rescript-react-native@0.75.0
npm error       node_modules/rescript-react-native
npm error         rescript-react-native@"*" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^18.2.0" from react-native@0.77.0
npm error node_modules/react-native
npm error   peer react-native@">=0.75.0" from rescript-react-native@0.75.0
npm error   node_modules/rescript-react-native
npm error     rescript-react-native@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/el/.npm/_logs/2025-02-01T02_31_04_367Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/el/.npm/_logs/2025-02-01T02_31_04_367Z-debug-0.log

Activity

  1. switch-to-gitlab commented on Feb 1, 2025

    @switch-to-gitlab
    Author

    @MoOx I went ahead and put a bounty on this issue because I appreciate the work here and want it to succeed. https://app.opire.dev/issues/01JJZPGZPE4MGKQEWBVBQZBJX8

  2. EDLLT commented on Feb 2, 2025

    @EDLLT
  3. switch-to-gitlab commented on Feb 2, 2025

    @switch-to-gitlab
    Author

    @EDLLT Ah, I'll bet that works. Thanks. I probably won't have time to test it out today or tomorrow but Tuesday and Wednesday look promising.

  4. switch-to-gitlab commented on Feb 5, 2025

    @switch-to-gitlab
    Author

    @EDLLT Okay yeah that worked. Are you able to claim the money through Opire or would you like me to pay you some other way? This is the first issue I've bountied so I'm a little unfamiliar with the process and I'm not sure if the software will accept a PR link to a different repo.

  5. switch-to-gitlab commented on Feb 5, 2025

    @switch-to-gitlab
    Author

    @EDLLT You should have received a payment for the workaround.

    I'll leave the Opire bounty up and this issue open in case one of the maintainers wants to fix it in this repo.

  6. KartikeyNamdev commented on Mar 11, 2025

    @KartikeyNamdev

    I can fix it in the repo, but can i claim the bounty ??

  7. Freddy03h commented on May 15, 2025

    @Freddy03h
    Member

    @switch-to-gitlab

    In a react-native project you should specify a fixed react and react-native version in your package.json
    (example : migration from 0.77 to 0.78)

    Then choose the @rescript/react and rescript-react-native according to yours react and react-native versions.

    You shouldn't get issue if you follow these rules. But, if still get a relative issue, you can specify overrides versions in your package.json for npm : npm overrides or resolutions for yarn : yarn resolutions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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