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

Bun throws 'index out of bounds' when installing packages on Windows #9796

Closed
m1abdullahh opened this issue Apr 1, 2024 · 14 comments
Closed
Labels
bug Something isn't working needs repro Needs an example to reproduce windows An issue that only occurs on Windows

Comments

@m1abdullahh
Copy link

What version of Bun is running?

1.1.0

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

  1. Navigate to a dir containing a package-lock.json. (I also rm -rf'ed node_modules beforehand).
  2. Run bun i.

What is the expected behavior?

It should install all the packages without any issue.

What do you see instead?

I got an error, saying index out of bounds.
Here's the error:

image

uh-oh: index out of bounds
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a61) Windows x64
InstallCommand: extracted_packages(18) lockfile_migration_from_package_lock
HTTP: 256
Elapsed: 49793ms | User: 38890ms | Sys: 3015ms
RSS: 0.15GB | Peak: 0.15GB | Commit: 0.24GB | Faults: 45614
----- bun meta -----

0 00007FF7A89CA4C8
1 ???
2 ???
3 ???
4 ???
5 ???
6 ???
7 ???
8 ???
9 ???
10 ???
11 ???

Search GitHub issues https://bun.sh/issues or join in #windows channel in https://bun.sh/discord

thread 11476 panic: index out of bounds
???:?:?: 0x7ff7a771051a in ??? (bun.exe)
???:?:?: 0x7ff7a771123c in ??? (bun.exe)
???:?:?: 0x7ff7a758193b in ??? (bun.exe)
???:?:?: 0x7ff7a75785dd in ??? (bun.exe)
???:?:?: 0x7ff7a7572610 in ??? (bun.exe)
???:?:?: 0x7ff7a76254c2 in ??? (bun.exe)
???:?:?: 0x7ff7a7351603 in ??? (bun.exe)

???:?:?: 0x7ff7a9e87e33 in ??? (bun.exe)
???:?:?: 0x7fffe33d257c in ??? (KERNEL32.DLL)
???:?:?: 0x7fffe3f8aa57 in ??? (ntdll.dll)

Additional information

I just installed bun after watching the Bundows videos, and got this.

@m1abdullahh m1abdullahh added the bug Something isn't working label Apr 1, 2024
@gvilums gvilums added the windows An issue that only occurs on Windows label Apr 1, 2024
@gvilums
Copy link
Contributor

gvilums commented Apr 1, 2024

Hi, could you attach your package.json and package-lock.json?

@m1abdullahh
Copy link
Author

Quite unexpectedly, I reran bun i, and it worked fine. I don't know why it did so. Here are my package files.
package.json
package-lock.json

@gvilums
Copy link
Contributor

gvilums commented Apr 1, 2024

I unfortunately can't reproduce the crash, neither using both files nor just the package.json

@JL102
Copy link
Contributor

JL102 commented Apr 3, 2024

This happened the very first time I tried using bun to add a package to an existing package.json with a yarn.lock, but every time I try to reproduce it, I can't. It works fine now, even if I do bun pm cache rm, delete node_modules, delete the package I was adding from package.json (i was adding @types/bun), reinstall using yarn, and then re-run the command that initially failed (bun add --dev @types/bun). Dunno /shrug

@m1abdullahh
Copy link
Author

It seems like this error comes up on the first try of bun install.. and never after that.

@cimak
Copy link

cimak commented Apr 3, 2024

It seems like this error comes up on the first try of bun install.. and never after that.

not in my case, I'm getting this error every single time for bun install, bun add react or bun update .

// EDIT: this happens for both existing yarn project and for an empty (freshly initialised) project.

@m1abdullahh
Copy link
Author

It seems like this error comes up on the first try of bun install.. and never after that.

not in my case, I'm getting this error every single time for bun install, bun add react or bun update

Do you see the package name that was being installed when you got this error? Like I had apisauce in my case.

@cimak
Copy link

cimak commented Apr 3, 2024

It seems like this error comes up on the first try of bun install.. and never after that.

not in my case, I'm getting this error every single time for bun install, bun add react or bun update

Do you see the package name that was being installed when you got this error? Like I had apisauce in my case.

no:

OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19045 N/A Build 19045
C:\projects\buntest>bun init
bun init helps you get started with a minimal project and tries to guess sensible defaults. Press ^C anytime to quit

package name (buntest):
entry point (index.ts):

Done! A package.json file was saved in the current directory.
 + index.ts
 + .gitignore
 + tsconfig.json (for editor auto-complete)
 + README.md

To get started, run:
  bun run index.ts
C:\projects\buntest>bun run index.ts
Hello via Bun!
C:\projects\buntest>bun add react
bun add v1.1.0 (5903a614)

uh-oh: index out of bounds
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64
AddCommand:
Elapsed: 9ms | User: 0ms | Sys: 15ms
RSS: 44.10MB | Peak: 44.10MB | Commit: 91.93MB | Faults: 10924
----- bun meta -----

0   00007FF610DBA4C8
1   ???
2   ???
3   ???
4   ???
5   ???
6   ???
7   ???
8   ???
9   ???
10  ???
11  ???
12  ???
13  ???

Search GitHub issues https://bun.sh/issues or join in #windows channel in https://bun.sh/discord

thread 25920 panic: index out of bounds
???:?:?: 0x7ff60f9e03d8 in ??? (bun.exe)
???:?:?: 0x7ff60f8f73b8 in ??? (bun.exe)
???:?:?: 0x7ff60f8fac45 in ??? (bun.exe)
???:?:?: 0x7ff60f92cdda in ??? (bun.exe)
???:?:?: 0x7ff60f964ce0 in ??? (bun.exe)
???:?:?: 0x7ff60f962f55 in ??? (bun.exe)
???:?:?: 0x7ff60f9759c2 in ??? (bun.exe)
???:?:?: 0x7ff60fa1518b in ??? (bun.exe)
???:?:?: 0x7ff60f741603 in ??? (bun.exe)
???:?:?: 0x7ff612277e33 in ??? (bun.exe)
???:?:?: 0x7ffeb87f7343 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffeb8e426b0 in ??? (ntdll.dll)

@m1abdullahh
Copy link
Author

Yeah you're adding react. When I got this error, I was also running bun i in a react proj. dir.

@cimak
Copy link

cimak commented Apr 3, 2024

bun upgrade also doesn't work:

C:\projects\buntest>bun upgrade

uh-oh: index out of bounds
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64
UpgradeCommand:
Elapsed: 1ms | User: 0ms | Sys: 0ms
RSS: 22.56MB | Peak: 22.56MB | Commit: 70.80MB | Faults: 5641
----- bun meta -----

0   00007FF64735A4C8
1   ???
2   ???
3   ???
4   ???
5   ???
6   ???
7   ???
8   ???
9   ???

Search GitHub issues https://bun.sh/issues or join in #windows channel in https://bun.sh/discord

thread 1328 panic: index out of bounds
???:?:?: 0x7ff645f803d8 in ??? (bun.exe)
???:?:?: 0x7ff645fa4f41 in ??? (bun.exe)
???:?:?: 0x7ff645fa8ee6 in ??? (bun.exe)
???:?:?: 0x7ff645fb5ab7 in ??? (bun.exe)
???:?:?: 0x7ff645ce1603 in ??? (bun.exe)
???:?:?: 0x7ff648817e33 in ??? (bun.exe)
???:?:?: 0x7ffdb2517343 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffdb35026b0 in ??? (ntdll.dll)

@cavidev
Copy link

cavidev commented Apr 4, 2024

OS Name: Microsoft Windows 10
OS Version: Build 19044

uh-oh: index out of bounds
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.1 (ca1dbb4) Windows x64

Hi, today I did a "bun install" too and I am getting the same issue, anyone found a solution or some workaround??

@JL102
Copy link
Contributor

JL102 commented Apr 5, 2024

Hi, today I did a "bun install" too and I am getting the same issue, anyone found a solution or some workaround??

@CarlosMarioV is it happening consistently or did it only happen once? For me and most others I saw on this thread, it's a one time occurrence.

@cavidev
Copy link

cavidev commented Apr 5, 2024

Hi, today I did a "bun install" too and I am getting the same issue, anyone found a solution or some workaround??

@CarlosMarioV is it happening consistently or did it only happen once? For me and most others I saw on this thread, it's a one time occurrence.

During the morning this happened consistently after that I could download the libraries and I am not tested for today.

@Electroid
Copy link
Contributor

Duplicate of #9932

@Electroid Electroid marked this as a duplicate of #9932 Apr 8, 2024
@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro Needs an example to reproduce windows An issue that only occurs on Windows
Projects
None yet
Development

No branches or pull requests

6 participants