Skip to content

Standalone npm install tinybase in a new project fails (because of react 19?) #215

@CodingDoug

Description

@CodingDoug

Describe the bug

Following the instructions here:

mkdir MyFirstTinyBaseApp
cd MyFirstTinyBaseApp
npm init -y
npm install tinybase

The above fails during install with:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error   peerOptional react@">= 16.8.0" from [email protected]
npm error   node_modules/electric-sql
npm error     peerOptional electric-sql@"^0.12.1" from [email protected]
npm error     node_modules/tinybase
npm error       tinybase@"*" from the root project
npm error   peer react@"*" from @op-engineering/[email protected]
npm error   node_modules/@op-engineering/op-sqlite
npm error     peerOptional @op-engineering/op-sqlite@">= 2.0.16" from [email protected]
npm error     node_modules/electric-sql
npm error       peerOptional electric-sql@"^0.12.1" from [email protected]
npm error       node_modules/tinybase
npm error         tinybase@"*" from the root project
npm error   6 more (react-native, expo-sqlite, expo, @expo/dom-webview, ...)
npm error
npm error Could not resolve dependency:
npm error peerOptional react@"^18.2.0" from [email protected]
npm error node_modules/tinybase
npm error   tinybase@"*" 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 .../.npm/_logs/2025-02-20T21_16_34_699Z-eresolve-report.txt
npm error A complete log of this run can be found in: .../.npm/_logs/2025-02-20T21_16_34_699Z-debug-0.log

However, If I install react 18 first (not the latest 19), I can install tinybase with no trouble:

npm install -D react@18
npm install tinybase

I'm not sure why this is, as I am not very well acquainted with how peer or optional dependencies work.

I discovered this with a similar failure trying to upgrade a multi-module npm workspace (that doesn't use react at all) from tinybase 5.4.7 or 5.4.8. Not sure why this specific upgrade failed today, as I an normally diligent about keeping dependencies up to date.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

No response

Expected behavior

No response

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Not relevant
  • Version: 5.4.8

Additional context

No response

Metadata

Metadata

Labels

please verifyCould you see if this is better now?

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions