Closed swarthy closed 7 years ago
Hum I think it should wait until the the web server is started and then close it, because here you unload the trailpack without closing the web server, so next time you'll start the project it will complain because port is already used.
Sorry for my english :) I found this error when get stacked with another issue: when some trailpack throw error due initialize
, configure
or validate
trails stop app (unload all trailpacks) (see https://github.com/trailsjs/trails/blob/master/lib/trailpack.js#L43) (and my trailpack can't handle unload before initialization right way).
And if trailpack-express initialize
are not called before that moment, then unload will throw TypeError: Cannot read property 'close' of null
(nativeServer is not created)
No problem mine is worse lol
I understand the problem, but if initialize
is called but nativeServer
not created yet we have to wait for it or it will be create after trailpack-express is unload (and block the port). I'll accept this one and open an issue about this.
Thanks for this PR :)
Ah, you are right :) Dont know why I thought that trailpacks sequentially initialized :)
other trailpack initialization can fail and app will stop in this case you will get error