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

ReferenceError: Buffer is not defined #14

Open
VisionaryAppDev opened this issue Jun 5, 2023 · 0 comments
Open

ReferenceError: Buffer is not defined #14

VisionaryAppDev opened this issue Jun 5, 2023 · 0 comments

Comments

@VisionaryAppDev
Copy link

I tried to use this package in my Sveltekit project and got Buffer is not defined.

Here is my code:

  import FlakeId from "flake-idgen";
  import intformat from "biguint-format";

  const flakeIdGen = new FlakeId();
  let id = intformat(flakeIdGen.next(), "dec");

Here is my error log:

ReferenceError: Buffer is not defined
    at module.exports.next (flake-id-gen.js:58:13)
    at instance (MainComponent.svelte:11:49)
    at init (index.mjs:2165:11)
    at new MainComponent (MainComponent.svelte:24:23)
    at createProxiedComponent (svelte-hooks.js?v=8eec1919:341:9)
    at new ProxyComponent (proxy.js?v=8eec1919:242:7)
    at new Proxy<MainComponent> (proxy.js?v=8eec1919:349:11)
    at create_fragment (+page.svelte:12:97)
    at init (index.mjs:2180:37)
    at new Page (+page.svelte:141:20)

Not sure if this package will work in a Jamstack project.

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