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

Parcel does not watch/refresh changes inside a symlink folder #4950

Closed
sebelga opened this issue Jul 29, 2020 · 9 comments
Closed

Parcel does not watch/refresh changes inside a symlink folder #4950

sebelga opened this issue Jul 29, 2020 · 9 comments

Comments

@sebelga
Copy link

sebelga commented Jul 29, 2020

🐛 bug report

I have a folder in my repo that is a symlink to another repo folder. When I start parcel, it bundles and resolves the files in the symlink dir correctly.
When I change a file in that folder it does not watch for it and thus does not update the bundle. I need to stop the server, delete the cache (rm -rf .parcel-cache) and restart parcel to see the change.

There was a PR from @DeMoorJasper to fix this #1408, but I see that the tests for the symlink are skipped on the v2 branch (https://github.com/parcel-bundler/parcel/blob/v2/packages/core/integration-tests/test/watcher.js#L360). Does this mean that it is not currently supported?

Cheers! 👍

🤔 Expected Behavior

Files inside a symlink folder should be watched as if there where part of the project.

😯 Current Behavior

Parcel does not detect changes in the files inside a symlink folder.

@sebelga sebelga changed the title Parcel does not watch/refresh behind symlink folder Parcel does not watch/refresh changes inside a symlink folder Jul 29, 2020
@DeMoorJasper
Copy link
Member

That fix was for Parcel 1, the Parcel 2 watcher is definitely not the best in watching symlinks, it's already on the TODO.

I already added a test for this in the watcher repo but we still need to figure out how to properly handle this as it will require edits in both the watcher and Parcel core itself. parcel-bundler/watcher#32

@sebelga
Copy link
Author

sebelga commented Jul 29, 2020

Awesome thanks for the quick update @DeMoorJasper ! I will get around without symlink folders for now until Parcel supports it.

@zedissime
Copy link

@sebelga Did you find a workaround ? I'm facing to a similar problem.
I tried to create an alias pointing to the other folder in my .babelrc, which kinda works, but when I update the other folder, parcel fails with the following error :
Cannot read property 'type' of undefined

@sebelga
Copy link
Author

sebelga commented Aug 21, 2020

@zedissime No, I opted to not use symlinks for now.

@danieltroger
Copy link
Contributor

Hey guys, should adding --no-cache to parcel serve (parcel 2) workaround this? I tried to add --no-cache but it still seems to cache. Is that another bug or is it not meant to work the way I expect it to?

@mischnic
Copy link
Member

mischnic commented Jan 26, 2021

should adding --no-cache to parcel serve (parcel 2) workaround this

No, Parcel isn't even notified of the file change in this case.

@danieltroger
Copy link
Contributor

No, Parcel isn't even notified of the file change in this case.

Right, but with disabled cache it should still build with the changes in files it doesn't watch when saving a file it watches, shouldn't it? Which it doesn't, it just says "built in 60ms" (a full build takes like 1.5s).

@mischnic
Copy link
Member

No, it doesn't. --no-cache in server mode primarily applies to loading/saving the cache to disk.

@krisnye
Copy link
Contributor

krisnye commented Feb 4, 2021

This bug is a duplicate of #4332

@mischnic mischnic closed this as completed Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants