alexanderharm / node-carddav2phone

A CardDAV to IP phones converter for Node.js (AVM FRITZ!Box, Snom XCAP, Yealink)
MIT License
9 stars 1 forks source link

SyntaxError: Unexpected token { #11

Open FuxPCN opened 7 months ago

FuxPCN commented 7 months ago

After filling the config with my parameters and running the script I get the following error:

`node-carddav2phone/dist/index.js:1 import { settings } from './utils.js'; ^

SyntaxError: Unexpected token { at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)`

How can I solve it?

alexanderharm commented 7 months ago

Apparently you have one curly bracket { too much or you missed a closing one }. Can't say much more without the config...

FuxPCN commented 7 months ago

I don't think it's because of the settings.json:

  1. I reviewed and found no error.

  2. The error occurs with the settings.example.json too.

alexanderharm commented 7 months ago

which node version are you using?

FuxPCN commented 7 months ago

version 10.19.0

alexanderharm commented 7 months ago

that is old... maybe that does not understand commented json? did you try removing all comments from your settings file?

FuxPCN commented 7 months ago

After updating node to version 18.19 the syntax error is gone.

But the script now tells me "no vcards".

Tried with thunderbird (same URL, user and pass): There I see the one contact I created for testing.

What can I do?

alexanderharm commented 7 months ago

which carddav provider? does the user have a telephone number?

FuxPCN commented 7 months ago

Provider is eGroupware.

Yes, the user has got a phone number.

Am 21. Januar 2024 17:56:15 MEZ schrieb alexanderharm @.***>:

which carddav provider? does the user have a telephone number?

-- Reply to this email directly or view it on GitHub: https://github.com/alexanderharm/node-carddav2phone/issues/11#issuecomment-1902694715 You are receiving this because you authored the thread.

Message ID: @.***>

alexanderharm commented 7 months ago

would it be possible to give me access to a test account? otherwise i can provide a script to extract the returned object. maybe the structure is different to other providers...

FuxPCN commented 7 months ago

I'm a step further:

Can import one or more contacts. But:

  1. Script stays active - have to end with CTR+C.

  2. Updates fail with this message:

CardDAV: updates available LDAP: start LDAP: attempting bind LDAP: attempting search LDAP: search complete LDAP: attempting delete LDAP: oops something went wrong Error: entry must be a valid DN string or instance of LdapDn     at set entry [as entry] @./messages/lib/messages/delete-request.js:59:13)     at new DeleteRequest @./messages/lib/messages/delete-request.js:26:16)     at Client.del (/root/node-carddav2phone/node_modules/ldapjs/lib/client/client.js:361:15)     at file:///root/node-carddav2phone/dist/ldap.js:160:20     at new Promise ()     at ldapDelete (file:///root/node-carddav2phone/dist/ldap.js:159:17)     at file:///root/node-carddav2phone/dist/ldap.js:209:28     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)     at async Promise.all (index 0)

Manual ldapsearch & ldapdelete successful.

FuxPCN commented 7 months ago

And yes: I can give you a testaccount. How can I send the credentials to you?

alexanderharm commented 4 months ago

honestly, never tested anything other than apple's opendirectory. can you post your sanitized ldap config (of settings.json)?