Skip to content
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

[Yarn/Lerna] Workspaces: Watcher not working in v2 #6039

Closed
krnlde opened this issue Mar 22, 2021 · 6 comments
Closed

[Yarn/Lerna] Workspaces: Watcher not working in v2 #6039

krnlde opened this issue Mar 22, 2021 · 6 comments

Comments

@krnlde
Copy link

krnlde commented Mar 22, 2021

🐛 bug report

🎛 Configuration (.babelrc, package.json, cli command)

🤔 Expected Behavior

when I start the project with yarn start and then change the HelloWorld component that is imported from a yarn workspace the project will not recompile. We've had numerous discussions about it. I reference them in the "context" part.

😯 Current Behavior

The Change is not recognized and the page stays pristine, when I change somethin inside the app workspace itself the watcher pics the changes up and recompiles. So that is not an issue.

💁 Possible Solution

Pick up changes from workspace imports like parcel v1 does.

🔦 Context

This same repo works in parcel v1. In fact you can reproduce the same steps in the main branch of the repo for comparison.

💻 Code Sample

https://github.com/lookmom/nohands/tree/feature/parcel2 (pinned version)

🌍 Your Environment

Software Version(s)
Parcel parcel@2.0.0-beta.2
Node node@v15.12.0
npm/Yarn npm@7.6.3 , yarn@1.22.10
Operating System Windows 10 Pro (Insider Preview 21337)

The issue is present in every parcel v2 version, in every node version starting from 12, in every yarn version starting from 1.22, in every Windows 10 version starting from 1907. Also tested in WSL with Ubuntu 20.10 with the same results.

@krnlde krnlde changed the title [Yarn/Lerna] Workspaces not working in v2 [Yarn/Lerna] Workspaces: Watcher not working in v2 Mar 22, 2021
@krnlde
Copy link
Author

krnlde commented Mar 23, 2021

Alright! I have more insights on this bug.

TL;DR: If there is a false yarn.lock inside the starter workspace, the .parcel-cache will be created there and as a result the Watcher does not work properly.

In my case I start the app via parcel serve src/app/index.html and I had an old yarn.lock inside src/app. Parcel v2 then creates a src/app/.parcel-cache and the Watcher won't work properly. If I then remove the yarn.lock and start parcel again the .parcel-cache will be created in the root folder (as it should) and the Watcher works.

Still a bug or an improvement maybe.

@mischnic
Copy link
Member

Starting from your entry points, Parcel finds the first directory that contains a lockfile or a.git folder. This is the project root (any files outside of that aren't watched)

Still a bug or an improvement maybe.

I'm not sure how this could be improved

@krnlde
Copy link
Author

krnlde commented Mar 23, 2021

To clarify, I removed the dangling src/app/yarn.lock, nothing else, and it started working.

@krnlde
Copy link
Author

krnlde commented Mar 23, 2021

Looks like this behaviour to me:

@mischnic
Copy link
Member

No, it's here:

let projectRootFile =

nothing else, and it started working.

Yes, I can see how this fixed your problem. But there's not much we can do apart from documenting this behaviour.

@krnlde
Copy link
Author

krnlde commented Mar 23, 2021

Thank you. I'll close the issue since the actual problem is resolved.

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

No branches or pull requests

2 participants