garronej / evt

💧EventEmitter's typesafe replacement
https://evt.land
MIT License
454 stars 6 forks source link

Support esm module in node #22

Closed SOVLOOKUP closed 3 years ago

SOVLOOKUP commented 3 years ago

Is your feature request related to a problem? Please describe. cannot use evt in node esm module

import { Evt } from 'evt';
         ^^^
S module, which may not support all module.exports as named exports.CommonJS modules can always be imported via the default export, for example using:

import pkg from 'evt';
const { Evt } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:179:5)
    at async Loader.import (node:internal/modules/esm/loader:178:24)
    at async Object.loadESM (node:internal/process/esm_loader:68:5)
    at async handleMainPromise (node:internal/modules/run_main:63:12)

Describe the solution you'd like evt could use tsup to support a esm dist

Additional context the minimal repetition: https://github.com/SOVLOOKUP/rubickbase/tree/master/example

garronej commented 3 years ago

thanks you! Will fix today

garronej commented 3 years ago

Hi @SOVLOOKUP,

It's solved but you'll have to use the v2 beta.

-"evt": "^1.10.1",
+"evt": "2.0.0-beta.38",

Don't worry there wont be any breaking changes for you.

Best regards.

SOVLOOKUP commented 3 years ago

thanks!