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.
When importing the
createSession
method withimport { 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:
Using
better-sse@0.13.0
, running onNodeJS@22.9.0
.