Bun v1.1.8 (89d25807) Windows x64
Args: "C:\Users\Administrator\.bun\bin\bun.exe", "run", "bun.config.ts"
Features: jsc dotenv tsconfig_paths(4) tsconfig(10)
Builtins: "bun:main" "node:fs" "node:path" "node:string_decoder" "node:util/types"
Elapsed: 89ms | User: 156ms | Sys: 140ms
RSS: 0.28GB | Peak: 0.28GB | Commit: 0.41GB | Faults: 70159
panic(thread 17616): index out of bounds
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Stack Trace (bun.report)
Bun v1.1.8 (89d2580) on windows x86_64 [RunCommand]
How can we reproduce the crash?
【ignore.ts】 import type { BunPlugin } from 'bun'
export default (filter: RegExp, files: string[]): BunPlugin => { return { name: 'BunIgnore', setup(build) { build.onResolve({ filter }, (args) => { // 检查路径是否需要忽略 if (files.includes(args.path)) { return { path: args.path, external: true }; } return null; }) } } } 【bun.config.ts】 import { join } from 'path' import { existsSync, rmdirSync } from 'fs' import ignore from './plugins/ignore'
const distDect = join(__dirname, './dist') const hasDist = existsSync(distDect) hasDist && rmdirSync(distDect, { recursive: true })
async function main() { const output = await Bun.build({ entrypoints: ['./src/main.ts'], // target: 'bun', outdir: join(__dirname, './dist'), plugins: [ ignore( /@nestjs/, [ '@nestjs/microservices', '@nestjs/microservices/microservices-module', '@nestjs/websockets/socket-module', 'cache-manager', 'class-validator', 'class-transformer' ]) ] }) if (output.success) { console.log('打包成功') return } console.log('打包失败'); console.error(output.logs) }
await main()
Relevant log output
Stack Trace (bun.report)
Bun v1.1.8 (
89d2580
) on windows x86_64 [RunCommand]panic: index out of bounds
array_hash_map.zig:698
:getOrPutContextAdapted
event_loop.zig:246
:run
bundle_v2.zig:1728
:runFromJSInNewThread
0x17344
in KERNEL32.DLL0x526b1
in ntdll.dll