Skip to content

Cannot access 'IDBManager' before initialization #12

@WingCH

Description

@WingCH

Describe the bug
When running npm start, the following error occurs: ReferenceError: Cannot access 'IDBManager' before initialization, which prevents the project from starting.

To Reproduce
Steps to reproduce the behavior:

  1. Run npm start in the project root directory
  2. The terminal displays an error message
  3. The server fails to start

Expected behavior
The server should start successfully without any ReferenceError.

Screenshots
Error message:

file:///Users/wingch/mcp/mcp-server-simulator-ios-idb/dist/index.js:44
    const idbManager = new IDBManager();
                       ^

ReferenceError: Cannot access 'IDBManager' before initialization
    at createMCPServer (file:///Users/wingch/mcp/mcp-server-simulator-ios-idb/dist/index.js:44:24)
    at new MCPSimulatorServer (file:///Users/wingch/mcp/mcp-server-simulator-ios-idb/dist/mcp/mcp-server.js:36:34)
    at file:///Users/wingch/mcp/mcp-server-simulator-ios-idb/dist/mcp/mcp-server.js:133:16
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

Node.js v20.10.0

Desktop (please complete the following information):

  • OS: macOS (15.4.1 (24E263))

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A
  • Browser: N/A
  • Version: N/A

Additional context
It seems that IDBManager is being used before it is initialized or defined. Please check the import/require statements and the order of class definitions.
Node.js version: v20.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions