-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Watched directory is reported as initial-missing if has no files #224
Comments
I think such case is for nested empty directories |
Do you mean it works as expected? |
Yeah, because we need to track them too, what is the problem with it? Maybe you can provide example? |
Problem is that directory is not really missing, but And I am not saying that we should remove the check completely, I am saying that we don't need it when |
@WiseBird Sounds resonable can you send a PR? Also we will check all our test cases |
Stumbled upon this too. There is a function that results in setting up 3 directories watchers by Webpack: export function importVueFile(path: string): Promise<Component> {
// The app-specific component always prevails.
cache.files[path] ??= import(`@/apps/${__APP_ID__}/components/${path}.vue`)
// The fallback - is a component within the app's family.
.catch(() => import(`@/apps/${__APP_FAMILY__}/components/${path}.vue`))
// The last try goes to a global component.
.catch(() => import(`@/components/${path}.vue`))
.catch((error) => {
// eslint-disable-next-line no-console
console.error(error);
return {
inheritAttrs: false,
template: `There is no "${path}" component!`,
};
});
return cache.files[path];
} And, ironically, none of them have files inside - only child dirs:
Once I created one empty |
Causes webpack to constantly recompile as the directory is reported as removed:
Tried to reproduce but it works fine (more details below).
Basically, the culprit is the watch method of the
DirectoryWatcher
class, when it is triggered for the already inited directory.The method is triggered from the
WatcherManager
class:The flow looks like this:
My suggestion would be to additionally check that the
filePath
doesn't not equal tothis.path
before triggeringinitial-missing
event, but maybe I am missing something.The text was updated successfully, but these errors were encountered: