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

Vbet device not supported #111

Open
Draginfable opened this issue Jul 18, 2024 · 37 comments
Open

Vbet device not supported #111

Draginfable opened this issue Jul 18, 2024 · 37 comments

Comments

@Draginfable
Copy link
Contributor

Device: VT8200 UNC DUO USB P/N: 8257-91-00UK
Product Id: 0x0028

This product id is not included in the masks / deviceCmds and none of these four masks seem to work.

cc @maxwellmooney13 @jensengar
Please let me know if I need to provide more information.

@JunzheFan
Copy link
Contributor

hi, this productID is indeed not included in the current list. We recently redo some of the produtID and the supported device list should be updated accordingly, is it ok if we extract the code into a package and reference it from this project @maxwellmooney13 ?

@Draginfable
Copy link
Contributor Author

Hello @JunzheFan. Thanks for your feedback.
The Jabra implementation also takes advantage of the node module that they have provided, so I believe it would be great to directly use the vbet one in the respective implementation. This will also make maintenance easier, as all we will have to do is bump the version up.
If you prepare a PR, I will be happy to test it.

@JunzheFan
Copy link
Contributor

@Draginfable hi, I opened a PR for it, can you test if the device you have can function

@Draginfable
Copy link
Contributor Author

Draginfable commented Oct 2, 2024

Hello @JunzheFan, thanks a lot for your work.
Indeed I can confirm that VT8200 UNC DUO USB is now working :)
Additionally, I have also tested VT X300 BT and it is still working as expected.

However, I see that if I try to build the module, it fails.

npm run install:all
npm run build

This is the error:

> [email protected] build:src
> tsc -p .

node_modules/@vbet/webhid-sdk/dist/index.d.ts:33:46 - error TS2552: Cannot find name 'HIDDevice'. Did you mean 'IDevice'?
33 declare function createDeviceManager(device: HIDDevice): Promise<IDevice>;
                                                ~~~~~~~~~

node_modules/@vbet/webhid-sdk/dist/index.d.ts:41:13 - error TS2552: Cannot find name 'HIDDevice'. Did you mean 'IDevice'?
41 }): Promise<HIDDevice>;
               ~~~~~~~~~

Found 2 errors in the same file, starting at: node_modules/@vbet/webhid-sdk/dist/index.d.ts:33

On latest develop the build works. Could you please take a look?

Note 1: Build only works with node 16. It fails with node 18
Note 2: The production flag for webpack does not seem to work
cc @maxwellmooney13 @jensengar

> [email protected] build:module
> webpack --mode production

build mode: development

@JunzheFan
Copy link
Contributor

JunzheFan commented Oct 3, 2024

hi @Draginfable thanks for the testing and feedback! The error was due to missing TS definition for the w3c-WebHID APIs, so I changed the package API a bit, now when I run npm run build:src srcript against node 16 and 18, it was successfully built , can you pull the latest changes and build again

@Draginfable
Copy link
Contributor Author

Thanks @JunzheFan!
Indeed the first issue is resolved. However, the build also fails on the last step. To reproduce please either run:
npm run build or npm run build:module

> [email protected] build:module
> webpack --mode=production
...
[3] ./node_modules/@vbet/webhid-sdk/dist/index.mjs 6.55 KiB {0} [built] [failed] [1 error]
...
ERROR in ./node_modules/@vbet/webhid-sdk/dist/index.mjs 1:1395
Module parse failed: Unexpected token (1:1395)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

@maxwellmooney13
Copy link
Collaborator

Hi all, I apologize for not being responsive on this. We've been pulled into a number of other things that took our attention. @Draginfable thank you for raising the issue and bringing this to our attention and @JunzheFan thank you for raising a PR to hopefully handle this sorta stuff a lot better.

So the original issue is handled with the PR branch but the issue now is related to builds? I'll take a look today and see if I can make sense of it.

@Draginfable
Copy link
Contributor Author

Correct, on master I can build successfully using node 16 (not with 18), but if you checkout this branch the module build fails with both. It could be the same root cause. Please let me know if I can help.

@JunzheFan
Copy link
Contributor

JunzheFan commented Oct 8, 2024

@Draginfable @maxwellmooney13 I got different error on Terser plugin when building, but from the error shown above, it seemed the error was due to webpack is not configured to process mjs extension file, so I updated the package to output only js extension file for ES6, can you guys install again to test if error go away ?

@Draginfable
Copy link
Contributor Author

Unfortunately, I still get this error. It could be something on my environment though.
I have tried with node v16.20.2 and v18.20.4 on WSL2 Ubuntu 20.04.1 LTS.
@maxwellmooney13 Could you also please check if you get an error? Thanks!

@JunzheFan
Copy link
Contributor

@Draginfable can you confirm the error is still the unparsed extension [3] ./node_modules/@vbet/webhid-sdk/dist/index.mjs 6.55 KiB {0} [built] [failed] [1 error] ... , even though the .mjs extension is switched to index.es.js ? I am on a Windows machine, I did not get this error

@Draginfable
Copy link
Contributor Author

[3] ./node_modules/@vbet/webhid-sdk/dist/index.es.js 6.55 KiB {0} [built] [failed] [1 error]
...
ERROR in ./node_modules/@vbet/webhid-sdk/dist/index.es.js 1:1395
Module parse failed: Unexpected token (1:1395)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

@JunzheFan
Copy link
Contributor

softphone-vendor-headsets-develop npm run build:module

[email protected] build:module
webpack --mode production

build mode: development
Hash: 7f5880f098939c8f0ab4
Version: webpack 4.47.0
Time: 3388ms
Built at: 10/08/2024 6:32:10 PM
Asset Size Chunks Chunk Names
1.softhphone-vendor-headsets.js 2.03 KiB 1
1.softhphone-vendor-headsets.js.map 1.84 KiB 1 [dev]
2.softhphone-vendor-headsets.js 19.6 KiB 2
2.softhphone-vendor-headsets.js.map 18.2 KiB 2 [dev]
3.softhphone-vendor-headsets.js 1.71 KiB 3
3.softhphone-vendor-headsets.js.map 1.26 KiB 3 [dev]
softhphone-vendor-headsets.js 600 KiB 0 main
softhphone-vendor-headsets.js.map 713 KiB 0 [dev] main
Entrypoint main = softhphone-vendor-headsets.js softhphone-vendor-headsets.js.map
[1] ./react-app/src/library/types/consumed-headset-events.ts 757 bytes {0} [built]
[2] ./react-app/src/library/services/vendor-implementations/vendor-implementation.ts 10.4 KiB {0} [built]
[3] ./react-app/node_modules/browserama/out/browserama.min.js 972 bytes {0} [built]
[4] ./node_modules/events/events.js 14.5 KiB {0} [built]
[6] ./react-app/src/library/types/call-info.ts 0 bytes {0} [built]
[7] ./react-app/src/library/types/device-info.ts 0 bytes {0} [built]
[8] ./react-app/src/library/types/emitted-headset-events.ts 10 bytes {0} [built]
[9] ./react-app/src/library/types/headset-states.ts 0 bytes {0} [built]
[10] ./react-app/node_modules/fetch-jsonp/build/fetch-jsonp.js 3.78 KiB {0} [built]
[11] ./react-app/src/library/services/headset.ts + 61 modules 379 KiB {0} [built]
| ./react-app/src/library/services/headset.ts 38.7 KiB [built]
| ./react-app/src/library/services/vendor-implementations/CyberAcoustics/CyberAcoustics.ts 50.8 KiB [built]
| ./react-app/src/library/services/vendor-implementations/plantronics/plantronics.ts 43.8 KiB [built]
| ./react-app/src/library/services/vendor-implementations/sennheiser/sennheiser.ts 15.2 KiB [built]
| ./react-app/src/library/services/vendor-implementations/jabra/jabra.ts 45.1 KiB [built]
| ./react-app/src/library/services/vendor-implementations/jabra/jabra-native/jabra-native.ts 29.3 KiB [built]
| ./react-app/src/library/services/vendor-implementations/yealink/yealink.ts 34.6 KiB [built]
| ./react-app/src/library/services/vendor-implementations/vbet/vbet.ts 43.8 KiB [built]
| ./node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js 541 bytes [built]
| ./node_modules/rxjs/dist/esm5/internal/Subscription.js 5.54 KiB [built]
| ./node_modules/rxjs/dist/esm5/internal/config.js 231 bytes [built]
| ./node_modules/rxjs/dist/esm5/internal/util/noop.js 59 bytes [built]
| ./node_modules/rxjs/dist/esm5/internal/Subscriber.js 5.89 KiB [built]
| ./node_modules/rxjs/dist/esm5/internal/symbol/observable.js 161 bytes [built]
| ./node_modules/rxjs/dist/esm5/internal/util/identity.js 82 bytes [built]
| + 47 hidden modules
[12] ./react-app/src/library/index.ts 417 bytes {0} [built]
[13] ./node_modules/rxjs/dist/esm5/index.js 9.88 KiB [built]
[22] ./node_modules/rxjs/dist/esm5/operators/index.js 6.71 KiB [built]
[23] ./node_modules/rxjs/dist/esm5/internal/AsyncSubject.js 1.45 KiB [built]
[24] ./node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js 1.23 KiB [built]
+ 184 hidden modules

ERROR in softhphone-vendor-headsets.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:217:37
at Array.forEach ()
at TerserPlugin.optimizeFn (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:160:259)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :7:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1409:36
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1405:32
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.seal (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1342:27)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compiler.js:675:18
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1261:4
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :24:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1253:28)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compiler.js:672:17
at eval (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :11:1)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1185:12
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1097:9
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

ERROR in 1.softhphone-vendor-headsets.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:217:37
at Array.forEach ()
at TerserPlugin.optimizeFn (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:160:259)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :7:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1409:36
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1405:32
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.seal (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1342:27)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compiler.js:675:18
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1261:4
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :24:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1253:28)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compiler.js:672:17
at eval (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :11:1)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1185:12
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1097:9
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

ERROR in 2.softhphone-vendor-headsets.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:217:37
at Array.forEach ()
at TerserPlugin.optimizeFn (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:160:259)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :7:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1409:36
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1405:32
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.seal (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1342:27)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compiler.js:675:18
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1261:4
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :24:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1253:28)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compiler.js:672:17
at eval (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :11:1)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1185:12
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1097:9
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

ERROR in 3.softhphone-vendor-headsets.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:217:37
at Array.forEach ()
at TerserPlugin.optimizeFn (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/terser-webpack-plugin/dist/index.js:160:259)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :7:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1409:36
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1405:32
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.seal (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1342:27)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compiler.js:675:18
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1261:4
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :24:1)
at AsyncSeriesHook.lazyCompileHook (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1253:28)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compiler.js:672:17
at eval (eval at create (/Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/tapable/lib/HookCodeFactory.js:33:10), :11:1)
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1185:12
at /Users/chriszhan/Downloads/softphone-vendor-headsets-develop/node_modules/webpack/lib/Compilation.js:1097:9
at process.processTicksAndRejections (node:internal/process/task_queues:77:11). this is the result i GOT from build on both windows and MacOsx machine

@Draginfable
Copy link
Contributor Author

On develop I get an error with node 18. But it works with node 16.

@JunzheFan
Copy link
Contributor

@Draginfable @maxwellmooney13 hello, I found out the issue was because the vbet package was not transpile to es5 because the plugin it used does not support producing es5 egoist/rollup-plugin-esbuild#364, so I use the webpack babel loader in your project to transpile instead by changing the webpack config this line to /* if we are building for 'module', don't polyfill, transpile, or bundle any dependencies – except stanza because it has node deps... */ babelExcludes = [/node_modules\/(?!(core\-util\-is|@vbet[\\/]webhid-sdk)).*/];. the error went away, but am I not sure if it's ok to do so

@maxwellmooney13
Copy link
Collaborator

Hi all! Once again, I'm sorry for a lack of response here... I've had a lot of things come up that required attention. Great job finding a solution for the build issue! I'll look at the changes and double check to make sure it's okay.

@maxwellmooney13
Copy link
Collaborator

Pulling down the branch now to check

@maxwellmooney13
Copy link
Collaborator

Hey all, you guys probably already figured this out yourselves but with the branch locally, just making the change @JunzheFan suggested in the webpack config was not enough (however that change does fix the error mentioned regarding an appropriate loader being needed). I still had a bunch of Tenser related errors which were fixed by running npm update in both the root folder and react-app. So with those changes, the builds worked as expected though I still need to check how things work now if these updates had unexpected effects in regards to functionality. I'll be checking that in a little bit but wanted to put it out there for the time being. I'll also still do some digging for the "appropriate loader" error that has been discussed above to see if this is the best course of action and if that has any unexpected effects. Thank you both for your work and discussions on this and I apologize it took me so long to really dive into this

@maxwellmooney13
Copy link
Collaborator

@JunzheFan is the @vbet/webhid-sdk dependency already transpiled? I was looking for a solution on my own but nothing came of my research. I spoke with Garrett and he said that sometimes transpiling something twice could cause issues. Which would explain why your change to the babelExcludes part of the webpack.config.js is fixing the issue because then it is only transpiled once which is the original time it was transpiled. Hopefully that makes sense!

@JunzheFan
Copy link
Contributor

JunzheFan commented Oct 15, 2024

@maxwellmooney13 hello, yes indeed the package itself is not transpiled(i.e. no babel tools is configured) the output bundled code stay at modern es2015/es6 format which is not applicable to very old browswer, thus I need to resort to the webpack babel loader in this project to do the transpileing work, or I have to find another way to pre-transpiled the code to fit within the softphone-vendor-headsets project so that in this case the babelExcludes configuration is not needed

@maxwellmooney13
Copy link
Collaborator

Hi @JunzheFan I made a change that seems to work locally. In the webpack.config.js, in the module: {...} section, we currently have:

    module: {
      rules: [
        {
          test: /\.(cjs|mjs|js|ts)$/,
          loader: 'babel-loader',
          exclude: babelExcludes,
          options: babelOptions
        }
      ]
    }

but adding in

    module: {
      rules: [
        {
          test: /\.(cjs|mjs|js|ts)$/,
          loader: 'babel-loader',
          exclude: babelExcludes,
          options: babelOptions
        },
        {
          test: /\.es.js$/,
          include: [
            path.resolve(__dirname, 'node_modules/@vbet/webhid-sdk'),
          ],
          use: {
            loader: 'babel-loader'
          }
        }
      ]
    }

I'm not sure if there is a better way to make this cleaner but this seems to work, at the very least it builds properly for me but I'll need to try with the demo app and such to see that we are in fact all good.

@JunzheFan
Copy link
Contributor

@maxwellmooney13 hi, at the end of the day it comes to transpile the code down via babel, I have made a new version where babel is configured within the package itself so that webpack.config.js modification is not needed, can you pull down new package version and give it a try

@maxwellmooney13
Copy link
Collaborator

@JunzheFan I still had to run npm update for both the root directory and react-app to fix the Terser errors but I did notice that there was no issue around the loaders anymore. After running npm update, everything built totally fine! I'll need to make some time to check the demo app and such but so far looks good! Great job on this 👍 . So the most recent change is within the @vbet/webhid-sdk dependency right?

@Draginfable when you get a chance, I would like your opinion on the latest change too (more from a functionality standpoint)

@JunzheFan
Copy link
Contributor

@maxwellmooney13 yes recent changes is all within the package, regarding the testing, I noticed something strange in the demo app that when you init a Incomming call, the end All calls , end current call as well as the reject button will light up after that, but I suppose the reject button in this case is used to reject the incomming call from the UI, not sure the purpose of other two buttons, when I clicked those two buttons only the end All calls callback will be called but not for the end current call , so it failed to "end" the current incomming call, thereby the LED on the device will keep flashing

@Draginfable
Copy link
Contributor Author

Draginfable commented Oct 17, 2024

Great job guys! Thanks a lot!
I have just tested with the test app with both of my devices, and they both work perfectly, I will also test in my app and let you know.
Btw @JunzheFan, please also commit the package-lock.json.

EDIT:
@maxwellmooney13 I have just tested with my app as well. Both headsets work as expected. So from my side the PR is good to go as soon as @JunzheFan also commits the package-lock.json

@JunzheFan
Copy link
Contributor

hi guys I have updated package-lock.json to the newest package version

@JunzheFan
Copy link
Contributor

@maxwellmooney13 hi, the management is asking the estimated time the changes can get released to production ,do you have any idea, thanks

@maxwellmooney13
Copy link
Collaborator

@JunzheFan just merged your changes in. I'll need to make some time to go through the proper steps to get this into production but at this moment, your part in the change is done! I'll work on getting it to prod this week.

Is this issue good to close now?

@Draginfable
Copy link
Contributor Author

Great news. Looking forward to the release!

@maxwellmooney13
Copy link
Collaborator

Hi all, just as a heads up, I'm trying to get the changes in for a release but we are having some branching issues with the repo. We'll be able to get the changes out as soon as we fix these.

@JunzheFan
Copy link
Contributor

@maxwellmooney13 hey max, is this released or waiting for the pending PR you made ?

@maxwellmooney13
Copy link
Collaborator

Hi @JunzheFan I was bouncing between a few different things and got sidetracked from the PR. I'm going to merge my unit test PR to (hopefully) ensure proper builds of the release branch. I will do that tomorrow (tomorrow for me, later today for you!) and quickly get the release up and running.

@JunzheFan
Copy link
Contributor

@maxwellmooney13 morning,can you inform us when the release is done ,we wanted to do a few testing today found that the changes might not have been applied ,also do you know what's required for the devices to function on the desktop version app

@maxwellmooney13
Copy link
Collaborator

hi @JunzheFan ! at the earliest, i can get it out this weekend but i will keep you up to date. i will work on this today. as for the desktop app, we are currnetly unable to use WebHID functionality on the desktop app. we are actively looking for a proper solution though this may take a lot more effort.

@maxwellmooney13
Copy link
Collaborator

@JunzheFan Actively working on getting this out. Facing some blockers on our end that are making our process a bit more difficult but wanted you to know I am still working on this.

@maxwellmooney13
Copy link
Collaborator

Hi all, I think we finally got things sorted out and good! The way our release schedule works, I think we should get this out this weekend I believe. I will keep everyone updated if something changes. As always, I apologize for this whole process taking way longer than it should have but we are in sight of the finish line now! Thank you for the work on this and the testing provided for the change.

@Draginfable
Copy link
Contributor Author

Just out of curiosity, I tested with v2.5.4 and the vbet headsets seem to work fine. Is something important missing from this release, or is it ok if we use this one until the final one is released?

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

3 participants