Closed tido64 closed 1 week ago
@thymikee: Let me know what you think. I can submit a fix once we agree on a solution.
Ideally we should rely on peerDependencies
not on devDependencies
and I'm totally fine with adding peerDependencies
to the places that we check. But removing devDependencies
sounds like a breaking change 😕
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
Description
config
ignorespeerDependencies
and instead readsdevDependencies
:https://github.com/react-native-community/cli/blob/33646ef94a8cb4f9ce10d6db336c7a124144025b/packages/cli-config/src/findDependencies.ts#L18-L21
This leads to errors in
react-native-windows
autolinking (and possibly in other scenarios) where dependencies are only declared underpeerDependencies
and notdevDependencies
, for instance in@react-native-webapis/web-storage
we have the following:In this case,
config
outputs:If I add
react-native-windows
todevDependencies
,config
outputs:In my opinion, the correct fix should be to replace
devDependencies
withpeerDependencies
, but I don't know if this will break current scenarios so we should probably keep it as is and just addpeerDependencies
to the list infindDependencies.ts
.Reproducible Demo
In any project, you can run the following: