LedgerHQ / ledgerjs

⛔️ MOVED to monorepo "ledger-live"
https://github.com/LedgerHQ/ledger-live
Apache License 2.0
574 stars 375 forks source link

hw-app-str doesn't work with angular 6 #154

Closed phra closed 6 years ago

phra commented 6 years ago

angular 6 removed from webpack configuration nodejs core modules shims.. see https://github.com/stellar/js-stellar-base/issues/128 and https://github.com/angular/devkit/issues/967#issuecomment-391385515

i managed how to make stellar sdk work including the compiled version instead of the sources.

now my app fails with hw-app-str package because the code is depending on webpack that is not importing nodejs core modules shims:

image

gre commented 6 years ago

if i'm correct this works because crc dependency that depends on "buffer" https://github.com/alexgorbatchev/node-crc/blob/master/src/crc16_xmodem.js#L1

it depends on "buffer" implicitely? because i'm not seeing a direct dependency, weird.

Have you tried to add a dependency to "buffer" in your top level project?

    "buffer": "5.1.0",
phra commented 6 years ago

@gre explicitly depending on buffer should fix the problem. atm in my angular application the buffer library is included by angular-devkit and it's 4.x version, that doesn't work in the browser without nodejs shims.

image

and not by node-crc

image

see https://github.com/alexgorbatchev/node-crc/issues/53

phra commented 6 years ago

@gre i've sent #155 to solve the problem removing node-crc from the deps and backporting crc16xmodem() function so that we don't have to wait for https://github.com/alexgorbatchev/node-crc/issues/53 to fix this.