question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

web-bluetooth dependency should be transitive

See original GitHub issue

Describe the bug

Without "@types/web-bluetooth": "0.0.14", in my devDependencies the build fails with:

.....

node_modules/@vueuse/core/index.d.ts:396:32 - error TS2304: Cannot find name 'BluetoothDevice'.

396         onserviceadded: (this: BluetoothDevice, ev: Event) => any;
                                   ~~~~~~~~~~~~~~~

node_modules/@vueuse/core/index.d.ts:397:34 - error TS2304: Cannot find name 'BluetoothDevice'.

397         onservicechanged: (this: BluetoothDevice, ev: Event) => any;
                                     ~~~~~~~~~~~~~~~

node_modules/@vueuse/core/index.d.ts:398:34 - error TS2304: Cannot find name 'BluetoothDevice'.

398         onserviceremoved: (this: BluetoothDevice, ev: Event) => any;
                                     ~~~~~~~~~~~~~~~

node_modules/@vueuse/core/index.d.ts:401:26 - error TS2304: Cannot find name 'BluetoothRemoteGATTServer'.

401     server: vue_demi.Ref<BluetoothRemoteGATTServer | undefined>;
                             ~~~~~~~~~~~~~~~~~~~~~~~~~

Project uses TypeScript.

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
    Memory: 13.45 GB / 31.73 GB
  Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 3.1.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.12.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (102.0.1245.44)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @vueuse/core: 8.7.4 => 8.7.4
    vue: 3.2.37 => 3.2.37

Used Package Manager

yarn

Validations

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
holtwickcommented, Aug 10, 2022

Any updates on this? In “@vueuse/core”: “^9.1.0” I still see the error.

I was able to mitigate it by installing “@types/web-bluetooth” and adding “web-bluetooth” to “compilerOptions.types” in tsconfig.json, but it is a bit annoying to have this kind of workaround, since most users very likely are not using bluetooth features of the lib at all. Maybe this could become a separate package?

2reactions
Shinigami92commented, Jun 23, 2022

Seems it’s not solved via v8.7.5 🙁

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:340:15 - error TS2304: Cannot find name 'BluetoothLEScanFilter'.

340     filters?: BluetoothLEScanFilter[] | undefined;
                  ~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:348:24 - error TS2304: Cannot find name 'BluetoothServiceUUID'.

348     optionalServices?: BluetoothServiceUUID[] | undefined;
                           ~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:376:36 - error TS2304: Cannot find name 'BluetoothRemoteGATTServer'.

376             connect: () => Promise<BluetoothRemoteGATTServer>;
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:378:42 - error TS2304: Cannot find name 'BluetoothServiceUUID'.

378             getPrimaryService: (service: BluetoothServiceUUID) => Promise<BluetoothRemoteGATTService>;
                                             ~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:378:75 - error TS2304: Cannot find name 'BluetoothRemoteGATTService'.

378             getPrimaryService: (service: BluetoothServiceUUID) => Promise<BluetoothRemoteGATTService>;
                                                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:379:44 - error TS2304: Cannot find name 'BluetoothServiceUUID'.

379             getPrimaryServices: (service?: BluetoothServiceUUID | undefined) => Promise<BluetoothRemoteGATTService[]>;
                                               ~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:379:89 - error TS2304: Cannot find name 'BluetoothRemoteGATTService'.

379             getPrimaryServices: (service?: BluetoothServiceUUID | undefined) => Promise<BluetoothRemoteGATTService[]>;
                                                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:383:41 - error TS2304: Cannot find name 'WatchAdvertisementsOptions'.

383         watchAdvertisements: (options?: WatchAdvertisementsOptions | undefined) => Promise<void>;
                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:387:63 - error TS2304: Cannot find name 'BluetoothDevice'.

387             (type: "gattserverdisconnected", listener: (this: BluetoothDevice, ev: Event) => any, useCapture?: boolean | undefined): void;
                                                                  ~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:388:62 - error TS2304: Cannot find name 'BluetoothDevice'.

388             (type: "advertisementreceived", listener: (this: BluetoothDevice, ev: BluetoothAdvertisingEvent) => any, useCapture?: boolean | undefined): void;
                                                                 ~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:388:83 - error TS2304: Cannot find name 'BluetoothAdvertisingEvent'.

388             (type: "advertisementreceived", listener: (this: BluetoothDevice, ev: BluetoothAdvertisingEvent) => any, useCapture?: boolean | undefined): void;
                                                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:393:41 - error TS2304: Cannot find name 'BluetoothDevice'.

393         onadvertisementreceived: (this: BluetoothDevice, ev: BluetoothAdvertisingEvent) => any;
                                            ~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:393:62 - error TS2304: Cannot find name 'BluetoothAdvertisingEvent'.

393         onadvertisementreceived: (this: BluetoothDevice, ev: BluetoothAdvertisingEvent) => any;
                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:394:42 - error TS2304: Cannot find name 'BluetoothDevice'.

394         ongattserverdisconnected: (this: BluetoothDevice, ev: Event) => any;
                                             ~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:395:46 - error TS2304: Cannot find name 'BluetoothDevice'.

395         oncharacteristicvaluechanged: (this: BluetoothDevice, ev: Event) => any;
                                                 ~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:396:32 - error TS2304: Cannot find name 'BluetoothDevice'.

396         onserviceadded: (this: BluetoothDevice, ev: Event) => any;
                                   ~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:397:34 - error TS2304: Cannot find name 'BluetoothDevice'.

397         onservicechanged: (this: BluetoothDevice, ev: Event) => any;
                                     ~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:398:34 - error TS2304: Cannot find name 'BluetoothDevice'.

398         onserviceremoved: (this: BluetoothDevice, ev: Event) => any;
                                     ~~~~~~~~~~~~~~~

node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:401:26 - error TS2304: Cannot find name 'BluetoothRemoteGATTServer'.

401     server: vue_demi.Ref<BluetoothRemoteGATTServer | undefined>;
                             ~~~~~~~~~~~~~~~~~~~~~~~~~


Found 19 errors in the same file, starting at: node_modules/.pnpm/@vueuse+core@8.7.5_vue@3.2.37/node_modules/@vueuse/core/index.d.ts:340
Read more comments on GitHub >

github_iconTop Results From Across the Web

1296535 - Comment Keyboard shortcut not working correctly ...
which was released as part of `@lezer/html`, which is a transitive dependency. Therefore, executing `rebuild.sh` pulls in the fix.
Read more >
Web Bluetooth API - MDN Web Docs
The Web Bluetooth API provides the ability to connect and interact with Bluetooth Low Energy peripherals.
Read more >
Transitive dependency in DBMS - Tutorialspoint
When an indirect relationship causes functional dependency it is called Transitive Dependency. If P -> Q and Q -> R is true, then...
Read more >
Web-Bluetooth API, can not update characteristics. time ...
You missed a characteristic.startNotifications() call to start receive notification. example; setInterval would be fine to call readValue() ...
Read more >
WebBluetooth in Servo
In particular, the Web Bluetooth API focuses on minimizing the device attack surface ... The platform dependent code can be found in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found