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

w4 run crashes if the cart file is deleted #570

Closed
majaha opened this issue Sep 27, 2022 · 0 comments
Closed

w4 run crashes if the cart file is deleted #570

majaha opened this issue Sep 27, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@majaha
Copy link
Contributor

majaha commented Sep 27, 2022

Running w4 run and then deleting the cartridge while it's running causes a crash.
For example, I ran rm output/cart.wasm during this run:

Matt@Matts-PC ~/p/w/w/wave-cycle (master)> w4 run --no-qr output/cart.wasm
Open http://localhost:4444. Press ctrl-C to exit.
✔ Reloaded cart.wasm
events.js:291
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open 'C:\cygwin64\home\Matt\prog\web\wasm4\wave-cycle\output\cart.wasm'
Emitted 'error' event on ReadStream instance at:
    at internal/fs/streams.js:136:12
    at FSReqCallback.oncomplete (fs.js:156:23) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\cygwin64\\home\\Matt\\prog\\web\\wasm4\\wave-cycle\\output\\cart.wasm'
}
Matt@Matts-PC ~/p/w/w/wave-cycle (master) [1]>

Which is a little annoying, as I like to delete all the stale build artefacts as part of my build process.
It would be nice if w4 run continued to watch the path and load the new file if one appears there.

@aduros aduros added bug Something isn't working good first issue Good for newcomers labels Oct 10, 2022
majaha added a commit to majaha/wasm4 that referenced this issue Mar 28, 2023
Fix the server crashing if the cart file is deleted (issue aduros#570)
Fix the server trying to re-read standard in when trying multiple ports
aduros added a commit that referenced this issue Apr 2, 2023
Fix several bugs in server.js, including #570
@majaha majaha closed this as completed Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants