nestdotland/eggs

[CRIT] An unexpected error occurred: "unacceptable kind of an object to dump [object Undefined] "

talentlessguy opened this issue · 1 comments

🐛 Bug Report

When I try to initialize a project with YAML config I get this error:

 ? Config format:  (JSON) › YAML
[CRIT] An unexpected error occurred: "unacceptable kind of an object to dump [object Undefined] "
[INFO] Debug file created. (/home/v1rtl/Coding/deno-libs/node-http/eggs-debug.log)
[INFO] If you think this is a bug, please open a bug report at https://github.com/nestdotland/eggs/issues/new/choose with the information provided in /home/v1rtl/Coding/deno-libs/node-http/eggs-debug.log
[INFO] Visit https://docs.nest.land/eggs/ for documentation about this command.

To Reproduce

  1. Installs eggs CLI
  2. Clone https://github.com/deno-libs/node-http
  3. run eggs init

Expected behavior

it should work the same as with JSON format (that works fine)

Actual Behavior

right after the last question in eggs init it throws an error

Environment

  • Eggs version: 0.3.6
  • Deno version: 1.10.2
  • Operating system and version: Linux 5.10.34

Additional context

eggs-debug.log:

Arguments:
  init

Deno version:
  deno: 1.10.2
  v8: 9.1.269.27
  typescript: 4.2.2

Eggs version:
  0.3.6

Platform:
  x86_64-unknown-linux-gnu

2021-05-24T14:48:17.735Z [DEBUG]    Config:  {
  "$schema": "https://x.nest.land/eggs@0.3.6/src/schema.json",
  name: "node_http",
  entry: "mod.ts",
  description: "Node.js-like HTTP server for Deno. Makes porting web things from Node (a little bit) easier.",
  homepage: "https://github.com/deno-libs/node-http",
  version: "0.0.5",
  releaseType: undefined,
  unstable: undefined,
  unlisted: undefined,
  files: [ "README.md", "mod.ts" ],
  ignore: [],
  checkFormat: false,
  checkTests: false,
  checkInstallation: false,
  check: false
} "yml"
2021-05-24T14:48:17.777Z [CRITICAL] An unexpected error occurred: "unacceptable kind of an object to dump [object Undefined] " "YAMLError: unacceptable kind of an object to dump [object Undefined] \n    at writeNode (https://hsfsnm7udm3pieto2djpc3d4ddwbhggrgsbc7thjikze6nt35ruq.arweave.net/PIsms_QbNvQSbtDS8Wx8GOwTmNE0gi_M6UKyTzZ77Gk/encoding/_yaml/dumper/dumper.ts:826:13)\n    at writeBlockMapping (https://hsfsnm7udm3pieto2djpc3d4ddwbhggrgsbc7thjikze6nt35ruq.arweave.net/PIsms_QbNvQSbtDS8Wx8GOwTmNE0gi_M6UKyTzZ77Gk/encoding/_yaml/dumper/dumper.ts:681:10)\n    at writeNode (https://hsfsnm7udm3pieto2djpc3d4ddwbhggrgsbc7thjikze6nt35ruq.arweave.net/PIsms_QbNvQSbtDS8Wx8GOwTmNE0gi_M6UKyTzZ77Gk/encoding/_yaml/dumper/dumper.ts:797:9)\n    at dump (https://hsfsnm7udm3pieto2djpc3d4ddwbhggrgsbc7thjikze6nt35ruq.arweave.net/PIsms_QbNvQSbtDS8Wx8GOwTmNE0gi_M6UKyTzZ77Gk/encoding/_yaml/dumper/dumper.ts:893:7)\n    at stringify (https://hsfsnm7udm3pieto2djpc3d4ddwbhggrgsbc7thjikze6nt35ruq.arweave.net/PIsms_QbNvQSbtDS8Wx8GOwTmNE0gi_M6UKyTzZ77Gk/encoding/_yaml/stringify.ts:20:10)\n    at writeConfig (https://re4puumiydm7ktehlneont2f3khlb6tvjj6r7drpq6jvovt4lgpa.arweave.net/iTj6UYjA2fVMh1tI5s9F2o6w-nVKfR-OL4eTV1Z8WZ4/src/context/config.ts:83:52)\n    at Command.init [as fn] (https://re4puumiydm7ktehlneont2f3khlb6tvjj6r7drpq6jvovt4lgpa.arweave.net/iTj6UYjA2fVMh1tI5s9F2o6w-nVKfR-OL4eTV1Z8WZ4/src/commands/init.ts:187:9)\n    at async Command.execute (https://bcolxl2pfbbbdl7s4t5a3rmxcbu3iwgzvszraewcf6xmotdnvmda.arweave.net/CJy7r08oQhGv8uT6DcWXEGm0WNmssxASwi-ux0xtqwY/command/command.ts:973:7)\n    at async Command.parse (https://bcolxl2pfbbbdl7s4t5a3rmxcbu3iwgzvszraewcf6xmotdnvmda.arweave.net/CJy7r08oQhGv8uT6DcWXEGm0WNmssxASwi-ux0xtqwY/command/command.ts:896:16)\n    at async Command.parse (https://bcolxl2pfbbbdl7s4t5a3rmxcbu3iwgzvszraewcf6xmotdnvmda.arweave.net/CJy7r08oQhGv8uT6DcWXEGm0WNmssxASwi-ux0xtqwY/command/command.ts:848:16)"

I think it happens because of some of those fields being undefined

fixed in #123