fusionjs / fusion-cli

Migrated to https://github.com/fusionjs/fusionjs
MIT License
140 stars 37 forks source link

dev process crashes after second error if initial build fails #441

Closed ganemone closed 6 years ago

ganemone commented 6 years ago

Type of issue

Bug

Description

If the initial build and subsequent build both fail, the dev process will crash with the following error:

Error: No entry found at /Users/giancarloanemone/dev/uber/web-monorepo/services/fusion-graphql-example/.fusion/dist/development/server/server-main.js
    at [eval]:40:20
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at Object.runInThisContext (vm.js:139:38)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:652:30)
    at evalScript (bootstrap_node.js:466:27)
    at startup (bootstrap_node.js:167:9)
    at bootstrap_node.js:612:3
/Users/giancarloanemone/dev/uber/web-monorepo/node_modules/fusion-cli/bin/cli-runner.js:12
  throw e;
  ^

Error: Received error message from server
    at ChildProcess.state.proc.on.message (/Users/giancarloanemone/dev/uber/web-monorepo/node_modules/fusion-cli/build/dev-runtime.js:157:18)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at emit (internal/child_process.js:772:12)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)

Current behavior

If the initial build and subsequent build both fail, the dev process will crash.

Expected behavior

The dev process should handle build errors gracefully.

Steps to reproduce

  1. Make the initial build of a project fail
  2. Save any file
ganemone commented 6 years ago

You can also reproduce this with a working initial build with the following steps:

  1. Working initial build
  2. Make a change where the build succeeds but the server crashes
  3. Make a change where the build fails
  4. Fix the failing build and server crash
  5. Dev process will crash