You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did this a gajillion times in a row on different things
// Helper function to check if a module can be imported - synchronous versionfunctioncanImportModule(moduleName: string): boolean{// Add debug loggingconsole.log('Resolving:',{
moduleName,cwd: process.cwd(),});// Check cache first to ensure consistent resultsif(moduleCache.has(moduleName)){returnmoduleCache.get(moduleName)!;}// Prevent infinite recursionif(processingModules.has(moduleName)){returntrue;}processingModules.add(moduleName);// Trust built-in modules (both Node.js and Bun)constbareModuleName=moduleName.replace(/^(node:|bun:)/,'');if(builtinModules.includes(bareModuleName)){processingModules.delete(moduleName);moduleCache.set(moduleName,true);returntrue;}try{// First, try to resolve as a packageconstresolvedPath=require.resolve(moduleName,{paths: [process.cwd()]});// If it resolves to node_modules, trust it completelyif(resolvedPath.includes('node_modules')){console.log('Resolved to node_modules:',resolvedPath);processingModules.delete(moduleName);moduleCache.set(moduleName,true);returntrue;}// For non-node_modules resolutions, continue with validationconstimports=extractImports(resolvedPath);constallImportsValid=imports.every(imp=>{// Resolve relative imports relative to the current fileif(imp.startsWith('.')){constdir=path.dirname(resolvedPath);returncanImportModule(path.resolve(dir,imp));}returncanImportModule(imp);});processingModules.delete(moduleName);moduleCache.set(moduleName,allImportsValid);returnallImportsValid;}catch(error){// If resolution fails, it's not a valid importprocessingModules.delete(moduleName);moduleCache.set(moduleName,false);returnfalse;}}
and it seg faulted
Relevant log output
Stack Trace (bun.report)
Bun v1.1.30 (7996d06) on macos aarch64 [TestCommand]
How can we reproduce the crash?
I did this a gajillion times in a row on different things
and it seg faulted
Relevant log output
Stack Trace (bun.report)
Bun v1.1.30 (
7996d06
) on macos aarch64 [TestCommand]Segmentation fault at address 0x00000008
??
??
??
??
??
??
??
??
??
Features: bunfig, jsc, transpiler_cache, tsconfig
Sentry Issue: BUN-22K
The text was updated successfully, but these errors were encountered: