ARMmbed/dapjs

get "Incorrect bytecount written" with latest master branch code.

wjzhang opened this issue · 5 comments

I download latest dapjs master branch code.
just modify package.json for new version of node-hid, usb:
"node-hid": "^0.7.9",
"usb": "^1.6.0",

use "rollup -c && typedoc src" build it.
then enter \examples\read-registers example. run " node hid.js" got "Incorrect bytecount written" error.

That's strange, little has changed recently.
I wonder if the return from node-hid has changed in more recent versions?

Sorry! I mistake, the "rollup -c && typedoc src" compile the os.platform() as "browser". what's right configuration for node environment?

when i directly modify rollup.config.js to ouput cjs format. it still optimize "os.platform()" as "browser".

when just remove the "rollup-plugin-node-builtins" from plugins. it'll OK and keep os.platform(). but get warning message:
.......
(!) Missing shims for Node.js built-ins
Creating a browser bundle that depends on 'events' and 'os'. You might need to include https://www.npmjs.com/package/rollup-plugin-node-builtins
(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
events (imported by src\proxy\cmsis-dap.ts)
os (imported by src\transport\hid.ts)
(!) Missing global variable names
Use output.globals to specify browser global variable names corresponding to external modules
events (guessing 'events')
os (guessing 'os')
.....

But read-registers example working ok.

@wjzhang I've not seen this problem and have reworked quite a lot of the code since this was raised. If the issue still persists, please feel free to reopen this issue.

Hello, there seems this problem appears again with the latest versions of DAPJs and node-hid.