Error: Can't resolve 'react' in '[...]/node_modules/zustand/esm'
bkimminich opened this issue · comments
Summary
Since 4.4.2 I am getting unexpected build failures in an application that has zustand
only as a subdependency:
./node_modules/zustand/esm/shallow.mjs:1:0-31 - Error: Module not found: Error: Can't resolve 'react' in '/home/runner/work/juice-shop/juice-shop/frontend/node_modules/zustand/esm'
Link to reproduction
As I am not using zustand
directly, I unfortunately can't deliver one. But adding zustand
to my direct dependencies as "zustand": "4.4.1"
solves the build issue.
- Sample failing build: https://github.com/juice-shop/juice-shop/actions/runs/6386342437
- Passing build after adding direct dependency on pinned 4.4.1: https://github.com/juice-shop/juice-shop/actions/runs/6389517851
Let's merge the discussion into #2095.