Skip to content

Requiering dist/index.cjs.js result in error "Cannot read properties of undefined (reading 'on')" #4

@d-Pixie

Description

@d-Pixie

Using the latest version in an Electron app (electron-forge with webpack). If I import the library it works fine. But I also have to require it in main.js, since it is Common JS, and that results in the above error.

Since one uses the dist/index.mjs.js file and the other the dist/index.cjs.js I suspect something with how the latter is built is amiss.

It could conceivably also be how my project builds, but I donät think so since the error points straight to the file in node_modules.

I could also solve the problem by converting the project to mjs, but I tried that and got stuck 🙂 Too bad that the boilerplate is still in cjs ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions