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

support TypeScript decorators #101

Open
mikelpr opened this issue Jan 14, 2022 · 2 comments
Open

support TypeScript decorators #101

mikelpr opened this issue Jan 14, 2022 · 2 comments

Comments

@mikelpr
Copy link

mikelpr commented Jan 14, 2022

I'm getting these when I try to use the @method({}) decorator:

TypeError: Cannot read properties of undefined (reading 'value')
    at /home/mikel/Workspace/<>/node_modules/dbus-next/lib/service/interface.js:158:40
    at __decorate (/home/mikel/Workspace/<>/node_modules/tslib/tslib.js:99:114)
    at file:///home/mikel/Workspace/<>/dist/index.js:189:1
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

options.fn = descriptor.descriptor.value;

Debugging with vscode shows me that descriptor is my Interface but descriptor.descriptor is undefined so it fails on that descriptor.descriptor.value

@mikelpr
Copy link
Author

mikelpr commented Jan 14, 2022

ok so I see it works if I use js and babel, while it does not work with typescript's decorators. also that the @Property decorator doesn't crash on typescript but doesn't show up in D-Feet anyway. so it's a general typescript incompatibility

@acrisci
Copy link
Member

acrisci commented Jan 14, 2022

https://acrisci.github.io/doc/node-dbus-next/module-interface-Interface.html

use configureMembers(). If there's a way to make the decorators compatible with TypeScript let me know.

@mikelpr mikelpr changed the title TypeError: Cannot read properties of undefined (reading 'value') support TypeScript decorators Oct 11, 2022
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