-
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
Flow does not find files behind a symbolic link directory path #4015
Comments
Any progress on this? This makes it hard to used linked modules with flow, e.g. yarn link. |
I can confirm flow fails to find a module that exists in |
this turns out really painful to deal with in complex codebases |
This will also prevent flow types from working in development for dependent packages in yarn workspaces. |
I've just encountered this, in the context of using It would be really nice if flow could follow |
It turns out that the workaround in #164 works for me (on Linux) - stop and restart the flow server after setting up the Ideally flow would notice without a restart, but at least there is a workaround. |
Stopping and starting flow resolved this issue for me |
using |
@andiwinata Why do you post a comment if you don't have this issue??? The 2nd guy who tells us that they don't have a problem. Did you test THIS specific problem? Did you check with the test project included in the initial comment (and follow the instructions to reproduce!)? |
hi @lll000111 , my bad, sorry about that. I was searching for issue about Again sorry for hijacking your issue |
THIS issue, or your issue? As I said, did you try to reproduce this issue? |
Does not work for me either
The .flowconfig cannot process
The symlink on windows is under src/ (I also tried |
I have gotten this work on windows. The [include] option in the .flowconfig has to point to the physical directory associated with the given symlinked directory
|
@vladp that was my issue as well https://flow.org/en/docs/config/include/ |
Enable flow types on our Gestalt docs. Improves type safety and caught a couple of actual issues. We previously did not enable these because of facebook/flow#4015. It does mean we might have to restart the docs server when we make a change to Gestalt. ## Test Plan `yarn flow` passes + checks the docs.
Flow: 0.46
Platform: Windows 10 (git-bash)
TL;DR: Files in a symlinked directory are not found, Flow does not seem to follow symlinks at least on Windows.
Tiny test project: Test.zip
WARNING: The ZIP included the sym-linked directory as full directory! Remove
Test/src/system/
and create a symlink with (on Windows)mklink /D system nodejs
insideTest/src/
. If you just unzip it and run Flow there are no errors - obviously.I use a symbolic link to link to one of my three directories with platform-dependent code (nodejs, browser, react-native). They all have the exact same files and API, just the platform-dependent part of the implementation.
Then I created a symbolic link named
system
pointing to the directory with the platform-dependent files. Before that I had./nodejs/someFile.js
in allrequire('...')
commands and used a build process to replace the "nodejs" with whatever platform the build was for.So after switching to this much cleaner method (no code rewrites) Flow gives me a
Required module not found
error for each one of the imports that look similar torequire('./system/storage-base.js');
(before it wasrequire('./nodejs/storage-base.js');
in thesrc/
directory and "nodejs" replaced after build in thelib/
directory).WebStorm has no problem with the symlink (just an aside).
I found #149 but that was closed by the author without giving a reason.
Also: #46 (comment)
And also #164 -- this sounds as if it should work when the Flow server is restarted and that only watching for changes is the issue, but I did restart
flow.exe
and it made no difference.The text was updated successfully, but these errors were encountered: