Cannot find module 'socket.io-redis'

I’ve just upgraded wappler from 3.9.x to 4.6.x and am getting the following in the log - server crashes as a result.

Any ideas on what needs to be changed to get back up and running … thanks

Error: Cannot find module ‘socket.io-redis’
Require stack:

  • /opt/node_app/lib/setup/sockets.js
  • /opt/node_app/lib/server.js
  • /opt/node_app/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at module.exports (/opt/node_app/lib/setup/sockets.js:15:30)
    at Object. (/opt/node_app/lib/server.js:47:12)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions…js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    ‘/opt/node_app/lib/setup/sockets.js’,
    ‘/opt/node_app/lib/server.js’,
    ‘/opt/node_app/index.js’

Many of the node modules are now installed on demand when marked once as “used” - this is done by just saving a single action that uses it.

In your case maybe save some of the websockets actions.

thanks George.

Scratch that- as soon as I enable REDIS the server fails to run and I get a 503 service unavailable

image

The issue in the logs is as follows:

Now I actually see that you are missing an older redis module that we actually do not use any more.

So probably you /lib files aren’t all up to date.

Just delete the /lib folder and save a server action to regenerate them.

Thanks - What lib folder specifically George ? Surely not the lib folder for the entire project ?

The “lib” folder in the root of your node project. Those are the Server Connect system files and will be regenerated with the latest one on a save of server action.

yes this one

Hi George,

Given that deleting the SC lib folder or the AC folders are quite often suggested as a solution for out-of-sync core file issues maybe you guys want to streamline this into it’s own button “Rebuild framework files” or similar which will do exactly the same but without calling it “Delete a folder and everything will be solved” slight_smile:

It’s the same, but product wise it’s nicer.

This is not common any more - only if you were upgrading from very old version.

Most issues we have tackled already in the new Project Assets Updater.

Still improving and adding stuff thought, more cooperation with git reverts as well maybe also adding updates checks for third party custom extensions.

Maybe also a force rebuild all framework files is a handy option, but we rather have it fully work so it is not needed.

2 Likes

Thanks George. That’s worked. One more thing off the upgrade ticklist - maybe I won’t leave it so long next time…

1 Like