-
Notifications
You must be signed in to change notification settings - Fork 96
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
Cannot read properties of undefined (reading 'findme') #71
Comments
I'm also experiencing this issue |
Hey guys. In the example code of the package, you can find this method. I tried it, and it works just fine. const iCloud = require('apple-icloud');
const session = {}; // An empty session. Has to be a session object or file path that points on a JSON file containing your session
const username = ""; // Your apple id
const password = ""; // Your password
// This creates your iCloud instance
const myCloud = new iCloud(session, username, password);
myCloud.on("ready", async function() {
const devices = await myCloud.FindMe.get();
console.log(devices);
}); Response: |
@Mittelblut9 It's not helps. the problem is that when it's trying to call for any of the functional methods (Calendar, FindMe.. it's doesn't matter), it's fails beacuse the Icloud object which returned has empty "account" field. and then when it's try to load it in the file, it's fails: var host = getHostFromWebservice(self.account.webservices.calendar); ("self" it's the Icloud object). I'll share my test file too, hopefully that someone will tell me what is wrong: const iCloud= require('apple-icloud');
var username="<My_username"> fs.writeFile("sessions/filesession.json","{}", function(err) {
}); var myCloud= new iCloud("sessions/filesession.json", username, password); myCloud.on('ready', async function(){
}); *important notice: I'm always able to create the "MyCloud" object with all the details, just the "account" field within it is empty. |
Upon running
await myCloud.FindMe.get(username, password)
,this error pops up
Full error:
TypeError: Cannot read properties of undefined (reading 'findme') at iCloud.__start (/Users/derrickw/VS Code Projects/Find My (Notifications)/node_modules/apple-icloud/resources/apps/FindMe.js:32:63) at Object.main.<computed> [as __start] (/Users/derrickw/VS Code Projects/Find My (Notifications)/node_modules/apple-icloud/resources/helper.js:84:27) at iCloud.__saveGet (/Users/derrickw/VS Code Projects/Find My (Notifications)/node_modules/apple-icloud/resources/apps/FindMe.js:88:19) at Object.main.<computed> [as __saveGet] (/Users/derrickw/VS Code Projects/Find My (Notifications)/node_modules/apple-icloud/resources/helper.js:84:27) at /Users/derrickw/VS Code Projects/Find My (Notifications)/node_modules/apple-icloud/resources/apps/FindMe.js:14:19 at new Promise (<anonymous>) at iCloud.get (/Users/derrickw/VS Code Projects/Find My (Notifications)/node_modules/apple-icloud/resources/apps/FindMe.js:13:26) at Object.main.<computed> [as get] (/Users/derrickw/VS Code Projects/Find My (Notifications)/node_modules/apple-icloud/resources/helper.js:84:27) at getDevices (/Users/derrickw/VS Code Projects/Find My (Notifications)/renderer.js:31:28) at processTicksAndRejections (node:internal/process/task_queues:96:5) {stack: 'TypeError: Cannot read properties of undefine…ions (node:internal/process/task_queues:96:5)', message: 'Cannot read properties of undefined (reading 'findme')'}
The text was updated successfully, but these errors were encountered: