Reproduce fastify-cli not crash

reproduce example for issue preParsing is undefined not null;

Test

There are two commands in package.json dev and dev-cli,

dev use manually written code to start the service -- will crash.

dev-cli use fastify start to start the service -- will not crash.

Key points

Here are two key points to not make fastify-cli crash:

  • build schema error
  • use app.ready(if you comment the app.ready statement in src/index.js, fastify-cli will crash).