Skip to content

Buffer not found in static build using sveltekit and Torus library #4

Description

@ralyodio

I need a way to alias Buffer for the browser.

Not sure which module requires this but its probably crypto related.

500

Buffer is not defined

@http://localhost:3000/_app/pages/index.svelte-2478ade3.js:1:111754

Problem is using Torus node library.

Here is a repo: https://github.com/ralyodio/torus-bufer

npm i
npm run build
npm run preview

...you will see error. npm run dev works fine since node handles requests. Its the browser only environment that is the issue.

The polyfill in svelte.config.js appears to not work: https://github.com/ralyodio/torus-bufer/blob/master/svelte.config.js

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