-
-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
starting the server with persistence seems to not work
To Reproduce
- in a terminal (dbDir exists)
HOST=localhost PORT=1234 YPERSISTENCE=./dbDir npx @y/websocket-server- results in an error:
Persisting documents to "./dbDir"
file:///home/me/.npm/_npx/17f6bbf3c399f7d5/node_modules/@y/websocket-server/src/utils.js:33
const LeveldbPersistence = require('y-leveldb').LeveldbPersistence
^
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/home/me/.npm/_npx/17f6bbf3c399f7d5/node_modules/@y/websocket-server/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///home/me/.npm/_npx/17f6bbf3c399f7d5/node_modules/@y/websocket-server/src/utils.js:33:30
at ModuleJob.run (node:internal/modules/esm/module_job:268:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)
Node.js v23.1.0
Without ypersistence it runs fine.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working