-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finding types from external dependencies when using Yarn workspaces #5107
Comments
We're hitting this too. It looks like Lerna is tracking this issue as well on lerna/lerna#891. |
This is confusing. It worked for me all the time, but somehow today it stopped working and I can not comprehend what I changed. Edit How it works The build process of my packages creates a |
It does seem like the obvious solution here would be for flow to adopt the node module resolution algorithm. |
This isn't really ideal, but is a workaround for flow not having access to parent node_modules directories (for now). See also: facebook/flow#5107
Has anyone managed to get this working? I'm trying to use |
Is there any chance someone could point me in the right direction, and I can try to open a PR? |
Because of facebook/flow#5107
@TxHawks @ajhyndman @langri-sha @taion @n1ru4l FYI there is a CLI called flow-mono-cli which solves most of the issues when working with flow in a mono-repo. Check it out, if you have any additional feature requests or feedback I am more than happy to hear from you guys! :) |
Until yarn workspaces get supported by Flow there's an workaround: use yarn's nohoist option to stop yarn from hoisting dependencies of workspaces that use flow. Eg. if you have a monorepo like
where workspace "workspaces": {
"nohoist": [
"A/**"
]
} Which will make yarn keep all A's deps in Note that this somehow contradicts the motivation behind workspaces. The
|
I'm running into an issue when using flow in a
yarn workspaces
enabled monorepoAfter installing
polished
withyarn workspace workspace-name add polished
I have adependencies.polished
entry in myworkspace-name
'spackage.json
, and apolished
directory under the repository's rootnode_modules
directory, as expected.Having a file in the workspace directory with:
Spits out:
It all works just fine when run Flow from the root directory, to which
node_modules
directory Yarn installs all the different workspaces' dependencies into.I'd expect Flow to look for type definitions in
node_modules
directories up the tree, in line with how npm and Yarn work.Flow version :
0.57.2
node version:
8.4.0
Yarn verson:
1.2.1
The text was updated successfully, but these errors were encountered: