[GH-ISSUE #177] ES6 TypeError: target.addListener is not a function #88

Closed
opened 2026-05-23 08:30:02 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @donl on GitHub (Nov 11, 2022).
Original GitHub issue: https://github.com/appy-one/acebase/issues/177

Originally assigned to: @appy-one on GitHub.

When using node.js import syntax I am getting the following error:

file:///app/node_modules/acebase/dist/esm/ipc/index.js:23
            target.addListener(event, handler);
                   ^

TypeError: target.addListener is not a function
    at bindEventHandler (file:///app/node_modules/acebase/dist/esm/ipc/index.js:23:20)
    at new IPCPeer (file:///app/node_modules/acebase/dist/esm/ipc/index.js:31:13)
    at new Storage (file:///app/node_modules/acebase/dist/esm/storage/index.js:409:24)
    at new AceBaseStorage (file:///app/node_modules/acebase/dist/esm/storage/binary/index.js:93:

    at new LocalApi (file:///app/node_modules/acebase/dist/esm/api-local.js:28:32)
    at new AceBase (file:///app/node_modules/acebase/dist/esm/acebase-local.js:33:20)
    at new AceBaseServer (file:///app/node_modules/acebase-server/dist/esm/server.js:53:19)
    at file:///app/server.js:131:16
Originally created by @donl on GitHub (Nov 11, 2022). Original GitHub issue: https://github.com/appy-one/acebase/issues/177 Originally assigned to: @appy-one on GitHub. When using node.js import syntax I am getting the following error: ``` file:///app/node_modules/acebase/dist/esm/ipc/index.js:23 target.addListener(event, handler); ^ TypeError: target.addListener is not a function at bindEventHandler (file:///app/node_modules/acebase/dist/esm/ipc/index.js:23:20) at new IPCPeer (file:///app/node_modules/acebase/dist/esm/ipc/index.js:31:13) at new Storage (file:///app/node_modules/acebase/dist/esm/storage/index.js:409:24) at new AceBaseStorage (file:///app/node_modules/acebase/dist/esm/storage/binary/index.js:93: at new LocalApi (file:///app/node_modules/acebase/dist/esm/api-local.js:28:32) at new AceBase (file:///app/node_modules/acebase/dist/esm/acebase-local.js:33:20) at new AceBaseServer (file:///app/node_modules/acebase-server/dist/esm/server.js:53:19) at file:///app/server.js:131:16 ```
Author
Owner

@appy-one commented on GitHub (Nov 11, 2022):

I have disabled usage of the generated ESM modules for now, updating acebase-server will also update your acebase package and fix this issue.

<!-- gh-comment-id:1312236438 --> @appy-one commented on GitHub (Nov 11, 2022): I have disabled usage of the generated ESM modules for now, updating `acebase-server` will also update your `acebase` package and fix this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase#88
No description provided.