nestdotland/eggs

Property 'prompts' is used before its initialization.

talentlessguy opened this issue ยท 3 comments

๐Ÿ› Bug Report

Whenever I run eggs command I get this:

error: TS2729 [ERROR]: Property 'prompts' is used before its initialization.
  private names: string[] = this.prompts.map((prompt) => prompt.name);
                                 ~~~~~~~
    at https://xqalpbanzpdlq4nxt35ywjwpm6xwayfdny3pnikd4cp2ozmyl3xa.arweave.net/vAC3hA3Lxrhxt577iybPZ69gYKNuNvahQ-Cfp2WYXu4/prompt/prompt.ts:2010:34

    'prompts' is declared here.
        private prompts: PromptOptions<string, any, any>[],
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        at https://xqalpbanzpdlq4nxt35ywjwpm6xwayfdny3pnikd4cp2ozmyl3xa.arweave.net/vAC3hA3Lxrhxt577iybPZ69gYKNuNvahQ-Cfp2WYXu4/prompt/prompt.ts:2018:5

~ via โฌข v15.12.0 via ๐Ÿ v3.9.2 
โžœ eggs update
error: TS2729 [ERROR]: Property 'prompts' is used before its initialization.
  private names: string[] = this.prompts.map((prompt) => prompt.name);
                                 ~~~~~~~
    at https://xqalpbanzpdlq4nxt35ywjwpm6xwayfdny3pnikd4cp2ozmyl3xa.arweave.net/vAC3hA3Lxrhxt577iybPZ69gYKNuNvahQ-Cfp2WYXu4/prompt/prompt.ts:2010:34

    'prompts' is declared here.
        private prompts: PromptOptions<string, any, any>[],
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        at https://xqalpbanzpdlq4nxt35ywjwpm6xwayfdny3pnikd4cp2ozmyl3xa.arweave.net/vAC3hA3Lxrhxt577iybPZ69gYKNuNvahQ-Cfp2WYXu4/prompt/prompt.ts:2018:5

~ via โฌข v15.12.0 via ๐Ÿ v3.9.2 
โžœ eggs --help
error: TS2729 [ERROR]: Property 'prompts' is used before its initialization.
  private names: string[] = this.prompts.map((prompt) => prompt.name);
                                 ~~~~~~~
    at https://xqalpbanzpdlq4nxt35ywjwpm6xwayfdny3pnikd4cp2ozmyl3xa.arweave.net/vAC3hA3Lxrhxt577iybPZ69gYKNuNvahQ-Cfp2WYXu4/prompt/prompt.ts:2010:34

    'prompts' is declared here.
        private prompts: PromptOptions<string, any, any>[],
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        at https://xqalpbanzpdlq4nxt35ywjwpm6xwayfdny3pnikd4cp2ozmyl3xa.arweave.net/vAC3hA3Lxrhxt577iybPZ69gYKNuNvahQ-Cfp2WYXu4/prompt/prompt.ts:2018:5

To Reproduce

  1. Install Deno 1.9
  2. Try to run eggs

Expected behavior

Work as usual.

Actual Behavior

It doesn't work, see error above.

Environment

  • Eggs version: 3.0.5
  • Deno version: 1.9.0
  • Operating system and version: Manjaro Linux x64

Additional context

Probably with the new minor Deno update it broke

sigh looks like cliffy again...

@talentlessguy thanks for reporting this, can you bring this up on our discord server so we can take a closer look at this?

PS: I think you meant eggs version 0.3.5?

@talentlessguy can you check if this issue still exists in eggs@0.3.6?

Install:

deno install -Afq --unstable https://x.nest.land/eggs@0.3.6/eggs.ts

@maximousblk now it works! thanks for resolving it very quickly