Skip to content

Package makes dApp crash with "Buffer is not defined" error #22

@BenAzlay

Description

@BenAzlay

I installed the package and now, my dApp crashes when it launches with this error in the console:

Uncaught ReferenceError: Buffer is not defined
    at ./node_modules/crypto-addr-codec/dist/index.js (index.js:1:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at ./node_modules/@siddomains/address-encoder/lib/index.module.js (refType.js:3:1)
    at options.factory (react refresh:6:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at ./node_modules/@siddomains/sidjs/dist/index.js (index.js:37:1)
    at options.factory (react refresh:6:1)

Looking at the code in /crypto-addr-codec/dist/index.js it seems that indeed Buffer is never initialized, though n is initialized with the safe-buffer library. I attempted to replace all mentions of single Buffer with n.Buffer but still have the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions