Skip to content

Cannot destructure property 'logger' of 'httpServer.scope' as it is undefined. #588

@mStirner

Description

@mStirner

In WORKER_THREADS_ENABLED=true mode, scope of the class httpServer is undefined:

[#1][2026.01.02 - 15:07:11.656][error][plugins/09d24b11-041f-4d4b-911c-f2ab04b4f60d] Could not init plugin
[#1]TypeError: Cannot destructure property 'logger' of 'httpServer.scope' as it is undefined.
    at new httpServer (/home/marc/projects/OpenHaus/backend/components/plugins/class.httpServer.js:40:15)
    at Plugin.httpServer (/home/marc/projects/OpenHaus/backend/components/plugins/class.plugin.js:552:16)
    at /home/marc/projects/OpenHaus/backend/plugins/09d24b11-041f-4d4b-911c-f2ab04b4f60d/index.js:1:1017
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

This is, beacuse the plugin component is not initalized.
With:

 await init_components([
            ...data.intents,
            //"plugins" // without this, class.httpServer.js is not correctly initalized
        ]);

in worker.js the problem is fixed.

But it feels overkill to init the whole componet incl. all plugin items again in each plugin!
Just init/set scope of the httpServer class?

httpServer.scope is only used to access the logger from the plugin component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that should not be like that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions