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

[🐞] [Optimizer Error] RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds #5565

Closed
yasserlens opened this issue Dec 11, 2023 · 3 comments
Labels
COMP: optimizer STATUS-2: missing info Incomplete issue/pr template or missing important information TYPE: bug Something isn't working WAITING FOR: user Further information is requested from the issue / pr opener

Comments

@yasserlens
Copy link

yasserlens commented Dec 11, 2023

Which component is affected?

Qwik Runtime

Describe the bug

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
at new NodeError (node:internal/errors:393:5)
at boundsError (node:internal/buffer:84:11)
at Buffer.readUInt16LE (node:internal/buffer:243:5)
at Object.validate (/.../node_modules/@builder.io/qwik/optimizer.cjs:123:35)
at finder (/.../node_modules/@builder.io/qwik/optimizer.cjs:2467:38)
at Array.find ()
at detector (/.../node_modules/@builder.io/qwik/optimizer.cjs:2468:17)
at lookup (/.../node_modules/@builder.io/qwik/optimizer.cjs:2471:18)
at getInfoForSrc (/.../node_modules/@builder.io/qwik/optimizer.cjs:2493:20)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_BUFFER_OUT_OF_BOUNDS'

Reproduction

See this stackblitz
https://stackblitz.com/edit/qwik-starter-fqky5z?file=src%2Froot.tsx

Steps to reproduce

Add a tag similar to the one below at root layout:

<script async type="text/javascript" dangerouslySetInnerHTML={` (function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"12345678"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.example.com/bat.js","uetq"); `}></script>

System Info

System:
    OS: macOS 13.2
    CPU: (12) x64 Apple M2 Pro
    Memory: 9.35 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.11.0 - ~/.nvm/versions/node/v18.11.0/bin/node
    npm: 8.19.2 - ~/.nvm/versions/node/v18.11.0/bin/npm
    pnpm: 7.9.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 120.0.6099.71
    Safari: 16.3
  npmPackages:
    @builder.io/partytown: ^0.8.0 => 0.8.1 
    @builder.io/qwik: ^1.2.13 => 1.2.18 
    @builder.io/qwik-city: ^1.2.13 => 1.2.18 
    undici: ^5.22.1 => 5.27.2 
    vite: ^4.4.0 => 4.5.0

Additional Information

This isn't a critical bug as it only happens locally - since the optimizer only runs in Dev mode. But annoying since this appears on every single page load. especially if the script above was added at root.

@yasserlens yasserlens added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Dec 11, 2023
@wmertens wmertens added COMP: optimizer and removed STATUS-1: needs triage New issue which needs to be triaged labels Jan 19, 2024
@gioboa gioboa added WAITING FOR: user Further information is requested from the issue / pr opener STATUS-2: missing info Incomplete issue/pr template or missing important information labels Jun 17, 2024
Copy link
Contributor

Hello @yasserlens. Please provide the missing information requested above.
Issues marked with STATUS-2: missing info will be automatically closed if they have no activity within 14 days.
Thanks 🙏

@wmertens
Copy link
Member

I see now that the stack of the error isn't the optimizer at all, the bundle file just happens to be named that way. It's inside getInfoForSrc, which is a js-only fetch to get information about an image. So the issue is in nodejs or so, not Qwik

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP: optimizer STATUS-2: missing info Incomplete issue/pr template or missing important information TYPE: bug Something isn't working WAITING FOR: user Further information is requested from the issue / pr opener
Projects
None yet
Development

No branches or pull requests

3 participants