**feat(storage): add script to reproduce FileSystemStorage initialization error**
- Created `reproduce_error.js` script to help debug FileSystemStorage initialization issues in Node.js environments. - Demonstrates error reproduction using `forceFileSystemStorage` option. - Captures and logs detailed error messages for better debugging. **Purpose**: Simplify the process of reproducing and diagnosing FileSystemStorage-related issues by providing a standalone script.
This commit is contained in:
parent
38c28ae038
commit
9b07c7f7d8
1 changed files with 27 additions and 0 deletions
27
reproduce_error.js
Normal file
27
reproduce_error.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Script to reproduce the FileSystemStorage initialization error
|
||||
*/
|
||||
|
||||
import { createStorage } from './dist/unified.js'
|
||||
|
||||
async function reproduceError() {
|
||||
console.log('Attempting to reproduce FileSystemStorage error...')
|
||||
|
||||
try {
|
||||
// This should trigger the same error as in the test
|
||||
const storage = await createStorage({ forceFileSystemStorage: true })
|
||||
console.log('Storage created successfully:', storage.constructor.name)
|
||||
|
||||
// This should fail with the fs/path modules error
|
||||
await storage.init()
|
||||
console.log('Storage initialized successfully')
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error reproduced:', error.message)
|
||||
console.error('Full error:', error)
|
||||
}
|
||||
}
|
||||
|
||||
reproduceError()
|
||||
Loading…
Add table
Add a link
Reference in a new issue