MatthewWid / better-sse

⬆ Dead simple, dependency-less, spec-compliant server-sent events implementation for Node, written in TypeScript.
https://matthewwid.github.io/better-sse/
MIT License
558 stars 14 forks source link

Named export 'createSession' not found #71

Closed go4cas closed 1 month ago

go4cas commented 1 month ago

When importing the createSession method with import { createSession } from 'better-sse, I get the following error:

"SyntaxError: Named export 'createSession' not found. The requested module 'better-sse' is a CommonJS module, which may not support all module.exports as named exports.".

The workaround is:

import pkg from 'better-sse'
const { createSession } = pkg

Using better-sse@0.13.0, running on NodeJS@22.9.0.

MatthewWid commented 1 month ago

Thanks for reporting this issue. A fix will be included in the next release.