Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ethernal listen causes TypeError: Cannot read property 'get' of undefined #19

Open
aspiers opened this issue Mar 16, 2022 · 3 comments
Open

Comments

@aspiers
Copy link

aspiers commented Mar 16, 2022

Excited to try out Ethernal for the first time! I created an account and workspace, however ethernal listen crashes:

$ ethernal listen

Start listening for transactions

Options:
      --help       Show help                                           [boolean]
      --version    Show version number                                 [boolean]
  -w, --workspace  Workspace to connect to.                             [string]
  -d, --dir        Project directory to watch                            [array]
  -s, --server     Do not watch for artifacts change - only listen for
                   transactions
  -l, --local      Do not listen for transactions - only watch contracts

TypeError: Cannot read property 'get' of undefined
    at getDefaultWorkspace (/home/adam/.nvm/versions/node/v14.17.0/lib/node_modules/ethernal/bin/index.js:389:69)
    at async setWorkspace (/home/adam/.nvm/versions/node/v14.17.0/lib/node_modules/ethernal/bin/index.js:405:28)
    at async setupWorkspace (/home/adam/.nvm/versions/node/v14.17.0/lib/node_modules/ethernal/bin/index.js:418:5)
    at async Object.listen [as handler] (/home/adam/.nvm/versions/node/v14.17.0/lib/node_modules/ethernal/bin/index.js:422:5)

I added some debug and saw that currentUser.data() returns:

currentUser.data() is {
  plan: 'free',
  apiKey: '<censored>',
  stripeCustomerId: 'cus_<censored>'
}

but the code implies it should be returning an object which has a currentWorkspace property. Seems that probably comes from the firebase db, so I guess it's a server-side issue?

@aspiers
Copy link
Author

aspiers commented Mar 16, 2022

If I try ethernal listen -w $my_workspace it still doesn't work. Debugging shows that

  currentWorkspace = await db.getWorkspace(options.workspace);

returns undefined.

@aspiers
Copy link
Author

aspiers commented Mar 16, 2022

OK, logging out and in again restarted the onboarding wizard, after which it worked. I suspect this was caused by me getting distracted half way through the onboarding wizard last time, so that somehow the workspace wasn't set up correctly. But it's odd because I could see the workspace in the UI even before completing the wizard.

@antoinedc
Copy link
Member

Your suspicion is correct :) it's failing when you start the CLI before creating a workspace.
I'll push a fix and I'll close this issue when it will be live, thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants