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

Crash: self.account is undefined #47

Open
alaq opened this issue May 29, 2020 · 3 comments
Open

Crash: self.account is undefined #47

alaq opened this issue May 29, 2020 · 3 comments

Comments

@alaq
Copy link

alaq commented May 29, 2020

Hello, first of all thanks for fixing #19!

Unfortunately I am now unable to run any of the examples. It seems that self.account is always undefined.

I get the following crash scan:

(node:18246) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'reminders' of undefined
    at iCloud.getOpenTasks (/home/adrien/git/roam-export/node_modules/apple-icloud/resources/apps/Reminders.js:7:63)
    at Object.main.<computed> [as getOpenTasks] (/home/adrien/git/roam-export/node_modules/apple-icloud/resources/helper.js:84:27)

Here is code that triggers it, it's the example from the README:

const myCloud = new iCloud(
    "icloud-session.json",
    process.env.ICLOUD_LOGIN,
    process.env.ICLOUD_PASSWORD
);

myCloud.on("ready", async function () {
    if (myCloud.twoFactorAuthenticationIsRequired) {
        prompt.get(["Security Code"], async function (err, input) {
            if (err) return console.error(err);
            const code = input["Security Code"];
            myCloud.securityCode = code;
        });
    } else {
        console.log("You are logged in completely!");
        const collections = await myCloud.Reminders.getOpenTasks(
            (err, tasks) => {
                if (err) console.error(err);
                else console.log(tasks);
            }
        );
        console.log(collections);
    }
});

I get the same issue with the demo examples, for any of the services.

I am not using 2FA, and it looks like I am logged in successfully because myCloud.loggedIn === true.

@nucks
Copy link

nucks commented May 30, 2020

@alaq I'm having the same problem. The API no longer seems to be working because self.account is always undefined.

@just4fun20
Copy link

@alaq I'm having the same problem. The API no longer seems to be working because self.account is always undefined.

nucks is there anyway to be able to talk to you personally?
Thanks in advance

@kopiro
Copy link
Contributor

kopiro commented Jul 10, 2020

#49

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

4 participants