|
| 1 | +#!/usr/bin/env bun |
| 2 | + |
| 3 | +console.log('=== Environment Debug Info ===') |
| 4 | +console.log('Bun version:', Bun.version) |
| 5 | +console.log('Platform:', process.platform) |
| 6 | +console.log('Architecture:', process.arch) |
| 7 | +console.log('Node version:', process.version) |
| 8 | +console.log('Working directory:', process.cwd()) |
| 9 | + |
| 10 | +console.log('\n=== File System Check ===') |
| 11 | +const files = [ |
| 12 | + 'wwwroot/test/object_info.json', |
| 13 | + 'wwwroot/test/JibMixRealisticv18.v1.json', |
| 14 | + 'src/to-api-prompt.ts' |
| 15 | +] |
| 16 | + |
| 17 | +for (const file of files) { |
| 18 | + const bunFile = Bun.file(file) |
| 19 | + console.log(`${file}: ${await bunFile.exists() ? 'EXISTS' : 'MISSING'}`) |
| 20 | + if (await bunFile.exists()) { |
| 21 | + const stat = await bunFile.stat() |
| 22 | + console.log(` Size: ${stat.size} bytes`) |
| 23 | + console.log(` Modified: ${stat.mtime}`) |
| 24 | + } |
| 25 | +} |
| 26 | + |
| 27 | +console.log('\n=== Package Dependencies ===') |
| 28 | +try { |
| 29 | + const packageJson = await Bun.file('package.json').json() |
| 30 | + console.log('Dependencies:', packageJson.devDependencies) |
| 31 | +} catch (e) { |
| 32 | + console.log('Error reading package.json:', e.message) |
| 33 | +} |
| 34 | + |
| 35 | +console.log('\n=== LiteGraph Import Test ===') |
| 36 | +try { |
| 37 | + const { LGraph, LGraphNode, LiteGraph } = await import('@comfyorg/litegraph') |
| 38 | + console.log('LiteGraph imported successfully') |
| 39 | + console.log('LGraph constructor:', typeof LGraph) |
| 40 | + console.log('LGraphNode constructor:', typeof LGraphNode) |
| 41 | + console.log('LiteGraph object:', typeof LiteGraph) |
| 42 | + |
| 43 | + // Test basic LGraph creation |
| 44 | + const graph = new LGraph() |
| 45 | + console.log('LGraph instance created:', !!graph) |
| 46 | + console.log('LGraph methods:', Object.getOwnPropertyNames(Object.getPrototypeOf(graph)).filter(name => typeof graph[name] === 'function').slice(0, 10)) |
| 47 | + |
| 48 | +} catch (e) { |
| 49 | + console.log('Error importing LiteGraph:', e.message) |
| 50 | + console.log('Stack:', e.stack) |
| 51 | +} |
| 52 | + |
| 53 | +console.log('\n=== Global Environment ===') |
| 54 | +console.log('globalThis keys:', Object.keys(globalThis).filter(k => k.includes('COMFY') || k.includes('litegraph'))) |
| 55 | + |
| 56 | +// Test the specific error scenario |
| 57 | +console.log('\n=== Testing Graph Creation ===') |
| 58 | +try { |
| 59 | + const { LGraph } = await import('@comfyorg/litegraph') |
| 60 | + const graph = new LGraph() |
| 61 | + |
| 62 | + // Check if the graph has the problematic property |
| 63 | + console.log('Graph properties:', Object.getOwnPropertyNames(graph).filter(name => name.includes('node') || name.includes('execution'))) |
| 64 | + |
| 65 | + // Try to call computeExecutionOrder which might trigger the error |
| 66 | + console.log('Testing computeExecutionOrder...') |
| 67 | + const executionOrder = graph.computeExecutionOrder(false) |
| 68 | + console.log('computeExecutionOrder succeeded, returned:', Array.isArray(executionOrder) ? `Array(${executionOrder.length})` : typeof executionOrder) |
| 69 | + |
| 70 | +} catch (e) { |
| 71 | + console.log('Error in graph creation test:', e.message) |
| 72 | + console.log('Stack:', e.stack) |
| 73 | +} |
0 commit comments