Example in React template throws cannot resolve dependency 'react' -- only with Lerna monorepo #116
Labels
kind: support
Asking for support with something or a specific use case
scope: docs
Documentation could be improved. Or changes that only affect docs
scope: integration
Related to an integration, not necessarily to core (but could influence core)
topic: monorepo
Related to Lerna monorepos
Current Behavior
When creating a new library with
tsdx
, by runningnpx tsdx create some-name
and choosing thereact
template, when attempting to run the example, the build fails with aCannot resolve dependency 'react'
error.Expected behavior
Build should not fail.
Suggested solution(s)
From what I understand, because the
package.json
insideexample
definesreact
andreact-dom
as aliases to the root directorynode_modules
, and the rootpackage.json
definesreact
as a peer dependency, we end up in a situation where react is never installed, hence the cannot resolve dependency error.Reverting the changes introduced in #88 locally, solves the problem. So removing the aliases and defining
react
andreact-dom
as dependencies insideexample/package.json
works as expected.Your environment
0.5.12
3.4.5
1.9.4
10.14.2
The text was updated successfully, but these errors were encountered: