yume-chan/ya-webadb

can't run dev : error using @yume-chan/adb-daemon-webusb

meetAndEgg opened this issue · 1 comments

Issue Checklist

  • I'm using the library programmatically
  • For Scrcpy related issues, I have searched in Genymobile/scrcpy repository.

Library version

@yume-chan/adb-daemon-webusb 0.0.20

Runtime

npm@9.8.0; vite@4.4.9; Microsoft Edge 115.0.1901.203 (正式版本) (64 位)

Device

NaN

Describe the bug

use npm run dev to start the project and give an error.

> vue-manage-system@5.3.0 dev
> vite


  VITE v3.0.9  ready in 344 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:10:17:
      10 │     let result = 0n;~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:14:19:
      14 │         result <<= 64n;
         ╵                    ~~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:30:23:
      30 │         while (value > 0n) {
         ╵                        ~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:33:22:
      33 │             value >>= 64n;
         ╵                       ~~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:40:23:
      40 │         while (value > 0n) {
         ╵                        ~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:42:22:
      42 │             value >>= 64n;
         ╵                       ~~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:153:15:
      153 │     const rr = 2n ** 4096n % n;
          ╵                ~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:153:21:
      153 │     const rr = 2n ** 4096n % n;
          ╵                      ~~~~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:173:20:
      173 │     if (modulus === 1n) {
          ╵                     ~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:174:15:
      174 │         return 0n;
          ╵                ~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:176:12:
      176 │     let r = 1n;
          ╵             ~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:178:22:
      178 │     while (exponent > 0n) {
          ╵                       ~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:179:44:
      179 │         if (BigInt.asUintN(1, exponent) === 1n) {
          ╵                                             ~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/adb/esm/daemon/crypto.js:183:21:
      183 │         exponent >>= 1n;
          ╵                      ~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/dataview-bigint-polyfill/esm/pure.js:7:8:
      7 │         32n) |
        ╵         ~~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/dataview-bigint-polyfill/esm/pure.js:19:65:
      19 │     return ((BigInt(a * bigEndianMask + b * littleEndianMask) << 32n) |
         ╵                                                                  ~~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/dataview-bigint-polyfill/esm/pure.js:23:31:
      23 │     const hi = Number(value >> 32n);
         ╵                                ~~~

X [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)

    node_modules/@yume-chan/dataview-bigint-polyfill/esm/pure.js:35:31:
      35 │     const hi = Number(value >> 32n);
         ╵                                ~~~

E:\vue-manage-system\vue-manage-system\node_modules\esbuild\lib\main.js:1624
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 18 errors:
node_modules/@yume-chan/adb/esm/daemon/crypto.js:10:17: ERROR: Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)
node_modules/@yume-chan/adb/esm/daemon/crypto.js:14:19: ERROR: Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)
node_modules/@yume-chan/adb/esm/daemon/crypto.js:30:23: ERROR: Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)
node_modules/@yume-chan/adb/esm/daemon/crypto.js:33:22: ERROR: Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)
node_modules/@yume-chan/adb/esm/daemon/crypto.js:40:23: ERROR: Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)
...
    at failureErrorWithLog (E:\vue-manage-system\vue-manage-system\node_modules\esbuild\lib\main.js:1624:15)
    at E:\vue-manage-system\vue-manage-system\node_modules\esbuild\lib\main.js:1266:28
    at runOnEndCallbacks (E:\vue-manage-system\vue-manage-system\node_modules\esbuild\lib\main.js:1046:63)
    at buildResponseToResult (E:\vue-manage-system\vue-manage-system\node_modules\esbuild\lib\main.js:1264:7)
    at E:\vue-manage-system\vue-manage-system\node_modules\esbuild\lib\main.js:1377:14
    at E:\vue-manage-system\vue-manage-system\node_modules\esbuild\lib\main.js:678:9
    at handleIncomingPacket (E:\vue-manage-system\vue-manage-system\node_modules\esbuild\lib\main.js:775:9)
    at Socket.readFromStdout (E:\vue-manage-system\vue-manage-system\node_modules\esbuild\lib\main.js:644:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: {
        column: 17,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 2,
        line: 10,
        lineText: '    let result = 0n;',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 19,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 3,
        line: 14,
        lineText: '        result <<= 64n;',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 23,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 2,
        line: 30,
        lineText: '        while (value > 0n) {',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 22,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 3,
        line: 33,
        lineText: '            value >>= 64n;',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 23,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 2,
        line: 40,
        lineText: '        while (value > 0n) {',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 22,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 3,
        line: 42,
        lineText: '            value >>= 64n;',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 15,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 2,
        line: 153,
        lineText: '    const rr = 2n ** 4096n % n;',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 21,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 5,
        line: 153,
        lineText: '    const rr = 2n ** 4096n % n;',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 20,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 2,
        line: 173,
        lineText: '    if (modulus === 1n) {',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 15,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 2,
        line: 174,
        lineText: '        return 0n;',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 12,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 2,
        line: 176,
        lineText: '    let r = 1n;',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 22,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 2,
        line: 178,
        lineText: '    while (exponent > 0n) {',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 44,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 2,
        line: 179,
        lineText: '        if (BigInt.asUintN(1, exponent) === 1n) {',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 21,
        file: 'node_modules/@yume-chan/adb/esm/daemon/crypto.js',
        length: 2,
        line: 183,
        lineText: '        exponent >>= 1n;',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 8,
        file: 'node_modules/@yume-chan/dataview-bigint-polyfill/esm/pure.js',
        length: 3,
        line: 7,
        lineText: '        32n) |',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 65,
        file: 'node_modules/@yume-chan/dataview-bigint-polyfill/esm/pure.js',
        length: 3,
        line: 19,
        lineText: '    return ((BigInt(a * bigEndianMask + b * littleEndianMask) << 32n) |',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 31,
        file: 'node_modules/@yume-chan/dataview-bigint-polyfill/esm/pure.js',
        length: 3,
        line: 23,
        lineText: '    const hi = Number(value >> 32n);',
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari13" + 2 overrides)'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 31,
        file: 'node_modules/@yume-chan/dataview-bigint-polyfill/esm/pure.js',
        length: 3,
        line: 35,
        lineText: '    const hi = Number(value >> 32n);',

Steps to reproduce

1.npm install @yume-chan/adb-daemon-webusb
2.use @yume-chan/adb-daemon-webusb. My code in a vue file:

<template>
    <div><el-button @click="pickDevice">connect</el-button></div>
</template>
<script lang="ts" setup>
import { AdbDaemonWebUsbDeviceManager } from '@yume-chan/adb-daemon-webusb'
const manager = new AdbDaemonWebUsbDeviceManager(window.navigator.usb)
const pickDevice = async () => {
    const cacheDevices = (await manager.getDevices()) || []
    let deviceMeta = undefined
    if (cacheDevices.length > 0) {
        deviceMeta = cacheDevices[0]
    } else {
        deviceMeta = await manager.requestDevice()
    }
    console.log(deviceMeta)
}
</script>

3.npm run dev