Skip to content

hathora init throws an error #261

@vyder

Description

@vyder

Was about to try making a project from scratch, and discovered that hathora init fails with this error:

<path>/node_modules/hathora/cli.js:28
        throw new Error("Doesn't appear to be inside a hathora project");
        ^

Error: Doesn't appear to be inside a hathora project
    at getProjectRoot (<path>/node_modules/hathora/cli.js:28:15)
    at getProjectRoot (<path>/node_modules/hathora/cli.js:30:12)
    at getProjectRoot (<path>/node_modules/hathora/cli.js:30:12)
    at getProjectRoot (<path>/node_modules/hathora/cli.js:30:12)
    at getProjectRoot (<path>/node_modules/hathora/cli.js:30:12)
    at getProjectRoot (<path>/node_modules/hathora/cli.js:30:12)
    at Object.<anonymous> (<path>/node_modules/hathora/cli.js:132:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)

Looks like the issue is that cli.ts (line 140) calls getProjectRoot at the top level of the file, but in the init scenario hathora.yml doesn't exist yet - and so it throws.

Additionally, running hathora --help throws the same error - which makes it hard to understand what is expected as a new user - since it's unclear what a 'hathora project' is yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions