-
Notifications
You must be signed in to change notification settings - Fork 504
Example in React template throws cannot resolve dependency 'react' -- only with Lerna monorepo #116
Copy link
Copy link
Closed
Labels
kind: supportAsking for support with something or a specific use caseAsking for support with something or a specific use casescope: docsDocumentation could be improved. Or changes that only affect docsDocumentation could be improved. Or changes that only affect docsscope: integrationRelated to an integration, not necessarily to core (but could influence core)Related to an integration, not necessarily to core (but could influence core)topic: monorepoRelated to Lerna monoreposRelated to Lerna monorepos
Description
Current Behavior
When creating a new library with tsdx, by running npx tsdx create some-name and choosing the react template, when attempting to run the example, the build fails with a Cannot resolve dependency 'react' error.
Expected behavior
Build should not fail.
Suggested solution(s)
From what I understand, because the package.json inside example defines react and react-dom as aliases to the root directory node_modules, and the root package.json defines react 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 and react-dom as dependencies inside example/package.json works as expected.
Your environment
| Software | Version(s) |
|---|---|
| TSDX | 0.5.12 |
| TypeScript | 3.4.5 |
| Browser | n/a |
| npm/Yarn | 1.9.4 |
| Operating System | Mac OS 10.14.2 |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind: supportAsking for support with something or a specific use caseAsking for support with something or a specific use casescope: docsDocumentation could be improved. Or changes that only affect docsDocumentation could be improved. Or changes that only affect docsscope: integrationRelated to an integration, not necessarily to core (but could influence core)Related to an integration, not necessarily to core (but could influence core)topic: monorepoRelated to Lerna monoreposRelated to Lerna monorepos