Skip to content

sm new root package.json pins @inertiajs/react ^1.0.0 but @simple-module-py/ui@0.0.8 peers ^2.0.0 — npm install fails ERESOLVE #128

Description

@antosubash

Summary

The npm-workspace root package.json that sm new (simple_module_cli==0.0.8) writes pins \"@inertiajs/react\": \"^1.0.0\". But @simple-module-py/ui@0.0.8 declares peerDependencies.@inertiajs/react: ^2.0.0. npm install fails with ERESOLVE on a fresh scaffold.

Reproduction

After fixing #126 and #127:

$ make install
...
npm error code ERESOLVE
npm error ERESOLVE could not resolve

While resolving: simple-module-chat@undefined
Found: @inertiajs/react@1.3.0
node_modules/@inertiajs/react
  @inertiajs/react@\"^1.0.0\" from the root project

Could not resolve dependency:
peer @inertiajs/react@\"^2.0.0\" from @simple-module-py/ui@0.0.8
node_modules/@simple-module-py/ui
  @simple-module-py/ui@\"0.0.8\" from the root project

Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps

Root cause

Generated root package.json:

{
  \"name\": \"simple-module-chat\",
  \"private\": true,
  \"type\": \"module\",
  \"dependencies\": {
    \"@simple-module-py/ui\": \"0.0.8\",
    \"@simple-module-py/i18n\": \"0.0.8\",
    \"react\": \"^19.0.0\",
    \"react-dom\": \"^19.0.0\",
    \"@inertiajs/react\": \"^1.0.0\"      ← stale
  },
  ...
}

vs. @simple-module-py/ui@0.0.8's declared peers:

\"peerDependencies\": {
  \"@inertiajs/react\": \"...\",          // ^2.0.0
  \"react\": \"^19.0.0\",
  \"react-dom\": \"^19.0.0\"
}

The scaffold template was written when @inertiajs/react was 1.x and never bumped when ui's peer was bumped to 2.x.

The bundled users / auth / dashboard / permissions module wheels also peer @inertiajs/react: ^2.0.0 (per their published package.json files), so this isn't a one-off — every consumer needs 2.x.

Suggested fix

Update the scaffold template:

   \"dependencies\": {
     \"@simple-module-py/ui\": \"0.0.8\",
     \"@simple-module-py/i18n\": \"0.0.8\",
     \"react\": \"^19.0.0\",
     \"react-dom\": \"^19.0.0\",
-    \"@inertiajs/react\": \"^1.0.0\"
+    \"@inertiajs/react\": \"^2.0.0\"
   },

Same fix in client_app/package.json if it also pins @inertiajs/react (the version I see currently has ^2.0.0 in client_app already, only the root is stale).

Workaround

sed -i '' 's/\"@inertiajs\\/react\": \"\\^1\\./\"@inertiajs\\/react\": \"^2./' package.json
rm -rf node_modules client_app/node_modules client_app/package-lock.json node_modules/.package-lock.json package-lock.json
npm install

Or npm install --legacy-peer-deps, which papers over it but produces a tree where ui's peer requirement isn't actually satisfied — likely to bite again at runtime.

Related

Environment

  • simple_module_cli 0.0.8
  • @simple-module-py/ui 0.0.8 (peer requires @inertiajs/react@^2.0.0)
  • npm 11.x (rejects peer mismatch by default)

Activity

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

    bugSomething isn't workingjavascriptPull requests that update javascript code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions