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

Getting process exit code 1 when changing files #45

Open
lostpebble opened this issue May 23, 2022 · 4 comments
Open

Getting process exit code 1 when changing files #45

lostpebble opened this issue May 23, 2022 · 4 comments

Comments

@lostpebble
Copy link

"C:\Program Files\nodejs\npm.cmd" run service-dev-watch

> [email protected] service-dev-watch
> wds --inspect=9230 ./src/index.ts

Debugger listening on ws://127.0.0.1:9230/f2cb6f48-1b77-4214-bf73-9f447f5b8098
For help, see: https://nodejs.org/en/docs/inspector
Running!!!
Service listening on port: 8080
Debugger attached.
[wds pid=23084] \src\index.ts changed, restarting ...

Process finished with exit code 1

Hi there, just started using this project today- but noticed the "hot reload" doesn't work for me. This includes simple updates like just changing the text inside a console.log(). I know it has nothing to do with the --inspect=9230 as I tried without it and it still threw the error.

@lostpebble
Copy link
Author

> [email protected] service-dev-watch
> cross-env WDS_DEBUG=1 ./node_modules/.bin/wds --inspect=9230 ./src/index.ts

[wds pid=12836] starting wds for workspace root C:\dev\github\xxx and workdir C:\Users\paulm\AppData\Local\Temp\wdsLTDysI
[wds pid=12836] Not loading project config from C:\dev\github\xxx\wds.js, error encountered: ENOENT: no such file or directory, access 'C:\dev\github\xxx\wds.js'
[wds pid=12836] Starting supervisor server at \\?\pipe\C:\Users\paulm\AppData\Local\Temp\wdsLTDysI\ipc.sock
[wds pid=12836] Started HTTP server on \\?\pipe\C:\Users\paulm\AppData\Local\Temp\wdsLTDysI\ipc.sock
[wds pid=12836] searching for filenames {
  config: { ignore: [], extensions: [ '.ts', '.tsx', '.jsx' ] },
  root: 'C:\\dev\\github\\xxx',
  globs: [
    '**/*{.tsx,.ts,.jsx,.mjs,.cjs,.js}',
    '!node_modules',
    '!**/*.d.ts'
  ]
}
[wds pid=12836] started build {
  root: 'C:\\dev\\github\\xxx',
  promptedBy: 'C:\\dev\\github\\xxx\\src\\index.ts',
  files: 5
}
Running!!!
Service listening on port: 8080
[wds pid=1516] syncworker file boot { isMainThread: false, hasWorkerData: true }
Debugger attached.
[wds pid=12836] \src\index.ts changed, restarting ...
[wds pid=12836] rebuild { duration: '0.03871' }
[wds pid=12836] child process exited with code null, exiting...

Process finished with exit code 1

This is the output using DEBUG mode.

@airhorns
Copy link
Contributor

airhorns commented May 24, 2022

Hm, it looks like you're running on WSL right? We have no formal support for windows or WSL but I will look into adding it. PRs also welcome! Also, that message is expected when the script you're actually running quits -- any chance you can share the contents of that script, or report that it works under other runners?

@lostpebble
Copy link
Author

Sure, this is the script. If I change anything inside of it, I get the exit code 1.

import koa from "koa";
import { ServiceConfig } from "./service_config";
import { middleware_health_check, middleware_ignore_favicon } from "./middleware/AppBasicMiddleware";
import logger from "koa-logger";

const { port } = ServiceConfig.getConfig();

const app = new koa({
  keys: ["xxx_secret_abc_123"]
});

app.use(logger());
app.use(middleware_ignore_favicon);
app.use(middleware_health_check);

app.use(async (ctx) => {
  ctx.body = "Hiiiii!";
});

app.listen(port, () => {
  console.log(`Service listening on port: ${port}`);
});

I'm not running WSL- just regular Windows.

I'm not sure what other runtimes I could compare it with. I can confirm that using nodemon to watch an output "dev-build" directory, which itself is watched and rebuilt by esbuild, runs and restarts without issue.

@airhorns
Copy link
Contributor

airhorns commented Jul 7, 2022

@lostpebble we just fixed a couple bugs with the --watch mode, could you try running with it now? Also, the default is no longer to watch/supervise by default, and so you'll have to update your scripts to pass --watch explicitly now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants