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

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

Open
ralyodio opened this issue May 19, 2022 · 1 comment
Open

Comments

@ralyodio
Copy link

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

@ralyodio
Copy link
Author

ralyodio commented May 19, 2022

Can someone please tell us how to fix? We are blocked by this issue. It works with with npm run dev which uses node to serve (and has Buffer). but when doing npm run build for a static sveltekit build Buffer is undefined in the browser.

Is there a browser version of torus-node? The specific module we are using is "@toruslabs/openlogin": "^1.7.1",

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

1 participant