Open jesusgollonet opened 1 month ago
I of course can make vim not generate those files, but I have never had to do that before.
Raising because I got this issue yesterday while trying framework for the first time and the constant crashes made me almost give up on it. And I would have missed out!
A naive attempt that seems to fix this is to just ignore files that end with tilde in visitFiles
, as they are quite likely backup files from vim. I quickly tried on the generated js code and crashes stopped. Haven't checked if this affects anything else.
function* visitFiles(root) {
const visited = /* @__PURE__ */ new Set();
const queue = [root = normalize(root)];
for (const path of queue) {
if (path.lastIndexOf('~') > -1){
continue;
}
const status = statSync(path);
if (status.isDirectory()) {
if (visited.has(status.ino))
continue;
...
Description:
When running npm run dev in one of the Observable examples, the engine frequently crashes. Upon investigation, I discovered that this issue is caused by Vim creating temporary files with a tilde (~) at the end, and then removing them. This triggers the engine to crash.
Steps to Reproduce
Expected Behavior:
The engine should handle the creation and removal of temporary files without crashing.
Actual Behavior:
The engine crashes whenever Vim creates and then removes temporary files with a tilde (~) at the end.
Environment:
Additional Information:
It would be helpful to implement a mechanism to ignore temporary files created by text editors like Vim to prevent the engine from crashing during development.
Error Log
(note the
~
at the end of the file):