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

[Error] Could not load (plugin commonjs) - file watching crashing #22714

Closed
michaeltoohig opened this issue Jun 10, 2024 · 1 comment
Closed

Comments

@michaeltoohig
Copy link

Describe the Improvement

Running directus-extension build -w will throw the following error.
This only happens when I open a file and then save it. But not every time I save the file, just usually the 2nd time I save the file. In this case this is the log when I modified a line in /path/to/module.vue which is the entrypoint for my custom module.

Now the odd thing is I'm seeing this problem using Neovim but not Nano. And when I last opened this project for development I was using VSCode and I never recall this problem.

So I don't know commonjs but I can guess the problem is likely a race condition when commonjs expects module.vue but when I save the file there is a window where module.vue is currently being replaced (aka missing) and the error is thrown. I also can't say for certain but the way that Neovim is saving the file is likely the culprit but I raise the issue here because maybe there's something that can be changed in the directus-extension build -w command that doesn't completely crash when a file is missing for a split second. Because at the moment I have to ctl-c and restart the command after this crash, the files are no longer being watch for more changes.

Watching files for changes...
✔ Done
Watching files for changes...
✔ Done
Watching files for changes...
✖ Failed
[Error] Could not load /path/to/module.vue: ENOENT: no such file or directory, open '/path/to/module.vue' (plugin commonjs)

Error: Could not load /path/to/module.vue: ENOENT: no such file or directory, open '/path/to/module.vue'
Copy link

Heya! There isn't enough information available to keep investigating this issue at present time, so it'll be closed until more information becomes available. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 19, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants