saltyshiomix / nextron

⚡ Next.js + Electron ⚡
https://npm.im/nextron
MIT License
3.97k stars 229 forks source link

Errors from renderer may be swallowed #58

Closed bkniffler closed 5 years ago

bkniffler commented 5 years ago

Hey, I've experienced errors from renderer getting swallowed by nextron. The result is no output, no electron starting, nothing. I could make them visible by modifying https://github.com/saltyshiomix/nextron/blob/master/lib/nextron-dev.ts#L94.

watching = compiler.watch({}, async (err, stats) => {
    // Start mod: Super dirty error handling, you get the point :)
    const errors = stats.toJson().errors;
    if (errors && errors.length) {
      console.error(new Error(errorss[0]));
    }
    // End mod
    if (!err && !stats.hasErrors()) {
      if (isHotReload) {
        await delay(2000);
      }
      isHotReload = true;
      spawn.sync('electron', ['.', `${rendererPort}`], spawnOptions);
    }
  });
saltyshiomix commented 5 years ago

@bkniffler

Thank you for your reporting the issue! I'll fix it later today 👍

saltyshiomix commented 5 years ago

@bkniffler

Fixed the issue and nextron@5.14.0 is out!

Also please check out improved main process' hot reloading feature :)

bkniffler commented 5 years ago

Wow! I'm so impressed by nextron and the effort you're putting into it, been using it for quite some time now for different small projects and its really been working greatly. Thanks for all your hard work!

saltyshiomix commented 5 years ago

@bkniffler

I'm very glad to hear that!

OSS drives me and take me the world we are still unseen :)