Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

create-symlinks occasionaly miss-place symlinks into the packages root #233

Open
kubijo opened this issue Apr 30, 2019 · 3 comments
Open

Comments

@kubijo
Copy link

kubijo commented Apr 30, 2019

Hi.

Did you ever encounter a behavior where the create-symlinks commands occasionaly miss-places symlinks from the root node_modules into the root, instead of packages/*/node_modules/?

To possibly illustrate this more clearly:

- package.json
- node_modules/
    - addon-notes
    - …
-  ↗ addon-notes
- packages/xyz/node_modules/

The ↗ addon-notes is the misplaced link to node_modules/addon_notes/.
It should be in packages/xyz/node_modules/, but it's missing there (so it's not a copy, but rather a misfire).

We've bump into this because it fails our lint CI jobs as it get's picked up by eslint, but would eventually cause flow errors as well since the module wouldn't be found in the package…

As of yesterday this started to happen semi-regularly on my dev machine as well (like 2 out of 4 tries).

If you have a hunch for a place that might be the culprit for some race-condition type of error, I'd be ready to help with tracking it down.

@kubijo
Copy link
Author

kubijo commented Apr 30, 2019

Our current hacky way around this is

find . -maxdepth 1 -type l | xargs --no-run-if-empty -i mv {} packages/xyz/node_modules/

@desmondgong
Copy link

I encounter the same issue sometimes. Not just into the root, the symlinks would occasionally be created into the wrong folder for the package include a scope.
For example, I have 2 dependencies: '@material-ui/core', '@ckeditor/ckeditor5-react', sometimes, the symlink for 'core' would go to the folder '@ckeditor'.
Screen Shot 2019-05-01 at 8 48 09 AM

btw, my ENV is macOS Mojave 10.14.4, node v11.12.0.

@IanVS
Copy link

IanVS commented Feb 11, 2020

I'm also experiencing this when packaging for our production deploys. For now I haven't noticed it in other situations, and I'm addressing by correctly setting NODE_ENV=production and not running flow-mono (should have been doing this all along), but it worries me that this could happen at any time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants