question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Encountered issue when compiling on `next dev` - RangeError: Array buffer allocation failed

See original GitHub issue

What version of Next.js are you using?

11.0.0

What version of Node.js are you using?

14.17.0

What browser are you using?

Firefox

What operating system are you using?

Windows 10

How are you deploying your application?

it is still under developement

Describe the Bug

Got error when running next dev. This error is intermittently happened after 15 minutes.

wait  - compiling...
internal/buffer.js:951
class FastBuffer extends Uint8Array {}
^

RangeError: Array buffer allocation failed
    at new ArrayBuffer (<anonymous>)
    at new Uint8Array (<anonymous>)
    at new FastBuffer (internal/buffer.js:951:1)
    at createUnsafeBuffer (buffer.js:152:12)
    at Function.allocUnsafeSlow (buffer.js:397:10)
    at read (E:\Workspace\cosmiq\webapp\node_modules\next\dist\compiled\webpack\bundle5.js:122381:32)
    at E:\Workspace\cosmiq\webapp\node_modules\next\dist\compiled\webpack\bundle5.js:122429:7
    at E:\Workspace\cosmiq\webapp\node_modules\next\dist\compiled\webpack\bundle5.js:29762:16
    at FSReqCallback.oncomplete (fs.js:180:23)

Expected Behavior

The compiling should running properly as usual.

The yarn build is running successfully.

yarn run v1.22.10
$ next build
info  - Loaded env from E:\Workspace\cosmiq\webapp\.env.local
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info  - Checking validity of types

./pages/api/oauth/[provider]/callback.ts
7:1  Warning: Assign arrow function to a variable before exporting as module default  import/no-anonymous-default-export

./pages/_document.tsx
9:11  Warning: Do not include stylesheets manually. See: https://nextjs.org/docs/messages/no-css-tags.  @next/next/no-css-tags

./components/svg/index.tsx
12:5  Warning: Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text


info  - Creating an optimized production build
info  - Compiled successfully
info  - Collecting page data
info  - Generating static pages (3/3)
info  - Finalizing page optimization

Page                                Size     First Load JS
┌ ○ /                               1.01 kB        91.8 kB
├   /_app                           0 B            63.7 kB
├ ○ /404                            3.18 kB        66.9 kB
├ λ /api/hello                      0 B            63.7 kB
├ λ /api/oauth/[provider]/callback  0 B            63.7 kB
├ λ /dashboard                      1.13 kB        91.9 kB
└ λ /login                          8.19 kB        89.4 kB
+ First Load JS shared by all       63.7 kB
  ├ chunks/framework.923004.js      42 kB
  ├ chunks/main.0c4bed.js           20.3 kB
  ├ chunks/pages/_app.88adf7.js     555 B
  ├ chunks/webpack.715970.js        804 B
  └ css/2fe097d1e0031b7f53b0.css    633 kB

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
   (ISR)     incremental static regeneration (uses revalidate in getStaticProps)

Done in 101.99s.

To Reproduce

I don’t know how to reproduce this.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
xSCIvencommented, Jun 24, 2021

I have now realised that I had accidentally downloaded the 32bit arch of node. You need the 64bit version to avoid this error. Check the architecture of your node install in node version manager for windows.

1reaction
timneutkenscommented, Nov 17, 2021

Closing as no reproduction was provided and there were no recent comments.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RangeError: Array buffer allocation failed at Object. #38 - GitHub
you are using the JS fallback (not the native compiled version of ttf2woff2); you have a lot of icons and it implies that...
Read more >
I keep getting this error "RangeError: Array buffer allocation ...
It might be related to your node version architecture. Check your version running the command node -p "process.arch".
Read more >
RangeError: invalid array length - JavaScript - MDN Web Docs
The JavaScript exception "Invalid array length" occurs when specifying an array length that is either negative, a floating number or exceeds ...
Read more >
Array buffer allocation failed - Serverless Forums
RangeError : Array buffer allocation failed at new Uint8Array (native) at createBuffer (buffer.js:68:17) at allocate (buffer.js:216:12)
Read more >
Node.js v19.3.0 Documentation
writeUIntLE(value, offset, byteLength); new Buffer(array); new Buffer(arrayBuffer[, ... Report errors in this documentation in the issue tracker.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found