sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

`sapper dev` watcher sometimes loses track of a file if editor save does a write-then-replace #949

Open ivan opened 4 years ago

ivan commented 4 years ago

Describe the bug

After introducing and removing an HTML error from a .svelte file, sapper dev stops watching and building.

Logs

src/routes/index.svelte changed. rebuilding...
✗ server
/home/at/code/js/sapper-template-rollup/src/routes/index.svelte
<input> is a void element and cannot have children, or a closing tag
44: </figure>
45: 
46: <input type="text"></input>
                       ^
47: 
48: help!
✗ client
/home/at/code/js/sapper-template-rollup/src/routes/index.svelte
<input> is a void element and cannot have children, or a closing tag
44: </figure>
45:
46: <input type="text"></input>
                       ^
47:
48: help!
✔ service worker (9ms)
^C

To Reproduce

  1. git clone https://github.com/sveltejs/sapper-template-rollup
  2. cd sapper-template-rollup && yarn install && yarn run dev
  3. In IntelliJ IDE with default settings, add invalid HTML in src/routes/index.svelte e.g. <input type="text"></input>, save, make the HTML valid again, save
  4. Observe no more automatic builds even after error is removed; need to restart sapper dev.

Expected behavior Continued builds :-)

Information about your Sapper Installation:

Additional context

# node --version
v12.12.0
# yarn --version
1.19.1
# uname -a
Linux ra 4.19.80-hardened #1-NixOS SMP Thu Oct 17 20:45:44 UTC 2019 x86_64 GNU/Linux
ivan commented 4 years ago

Things I noticed:

[pid 20022] <... futex resumed>)        = 1
[pid 20029] futex(0x7c62992671a0, FUTEX_WAKE_PRIVATE, 1) = 0
[pid 20029] statx(AT_FDCWD, "/home/at/code/js/sapper-template-rollup/src/routes", AT_STATX_SYNC_AS_STAT, STATX_ALL, {stx_mask=STATX_ALL, stx_attributes=0, stx_mode=S_IFDIR|0750, stx_size=101, ...}) = 0
[pid 20029] write(16, "\1\0\0\0\0\0\0\0", 8) = 8
[pid 20029] futex(0x7c6299267208, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 20022] epoll_pwait(13, [{EPOLLIN, {u32=16, u64=16}}], 1024, 5052, NULL, 8) = 1
[pid 20022] read(16, "\1\0\0\0\0\0\0\0", 1024) = 8
[pid 20022] futex(0x7c629926720c, FUTEX_WAKE_PRIVATE, 1) = 1
[pid 20022] epoll_pwait(13,  <unfinished ...>
[pid 20030] <... futex resumed>)        = 0
[pid 20030] futex(0x7c62992671a0, FUTEX_WAKE_PRIVATE, 1) = 0
[pid 20030] statx(AT_FDCWD, "/home/at/code/js/sapper-template-rollup/src/routes/index.svelte___jb_old___", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7c627f7fdc40) = -1 ENOENT (No such file or directory)
[pid 20030] write(16, "\1\0\0\0\0\0\0\0", 8) = 8
[pid 20022] <... epoll_pwait resumed>[{EPOLLIN, {u32=16, u64=16}}], 1024, 5052, NULL, 8) = 1
[pid 20022] read(16, "\1\0\0\0\0\0\0\0", 1024) = 8
[pid 20030] futex(0x7c6299267208, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
[pid 20022] epoll_pwait(13,  <unfinished ...>
[pid 20011] <... epoll_pwait resumed>[], 1024, 1000, NULL, 8) = 0
[pid 20011] openat(AT_FDCWD, "/proc/self/stat", O_RDONLY) = 21
[pid 20011] read(21, "20011 (yarn) R 20010 20007 2888 "..., 1023) = 300
[pid 20011] close(21)                   = 0
[pid 20011] epoll_pwait(13, [], 1024, 1000, NULL, 8) = 0
[pid 20011] openat(AT_FDCWD, "/proc/self/stat", O_RDONLY) = 21
[pid 20011] read(21, "20011 (yarn) R 20010 20007 2888 "..., 1023) = 300
[pid 20011] close(21)                   = 0
[pid 20011] epoll_pwait(13, ^C <unfinished ...>
[pid 20010] <... wait4 resumed>0x7fff0fd0f700, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
strace: Process 20010 detached
strace: Process 20011 detached