-
-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
Description
Checklist
- Are you reporting a bug? Use github issues for bug reports and feature requests. For general questions, please use https://discuss.yjs.dev/
- Try to report your issue in the correct repository. Yjs consists of many modules. When in doubt, report it to https://github.com/yjs/yjs/issues/
Describe the bug
y-protocols
should be a direct dependency, but is currently a transitive dependency through y-websocket
which is a dev dependency.
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/yjs/y-redis.git && cd y-redis
npm install --omit=dev
cp .env.template .env
and fill in appropriate valuesnpm run start:server
- Get the following error
$ npm run start:server
> @y/[email protected] start:server
> node --env-file .env ./bin/server.js
node:internal/modules/package_json_reader:256
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'y-protocols' imported from /home/user/code/y-redis/src/api.js
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:256:9)
at packageResolve (node:internal/modules/esm/resolve:768:81)
at moduleResolve (node:internal/modules/esm/resolve:854:18)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
at ModuleJob._link (node:internal/modules/esm/module_job:175:49) {
code: 'ERR_MODULE_NOT_FOUND'
}
Expected behavior
The server should start without any errors.
Environment Information
- Node.js version: v22.17.0
- Minimal setup does not use any y* modules
Additional context
The same issue is also encountered if @y/redis
is installed as a dependency instead of being cloned, and the bin/server.js
file is run using npx y-redis-server
- I'm a sponsor 💖
- This issue is a blocker for my project.