facebook / facebook/flow

Flow doesn't preserve symlinks

Open
#4,768 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Node has a --preserve-symlinks flag, which will allow package resolution to work correctly when using `lerna` or `npm link` with peerDependencies. Flow doesn't seem to have any understanding for symlinks, which means that it will consistently fail to check peerDependencies.

Test case: https://github.com/joshduck/test-flow/tree/master

```
# Run node using --preserve-symlinks flag:
npm run start
> A thinks a simple package is at /Users/duckj6g/Projects/test-flow/packages/a/node_modules/a-simple-package/index.js
> B thinks a simple package is at /Users/duckj6g/Projects/test-flow/packages/a/node_modules/a-simple-package/index.js

# Flow is unable to preserve symlinks:
npm run flow
> lerna ERR! execute Error: ../b/index.js:2
> lerna ERR! execute 2: const simple = require('a-simple-package');
> lerna ERR! execute ^^^^^^^^^^^^^^^^^^ a-simple-package. Required module not found
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.