You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the stacktrace I get when I try using host and port directly on cache: {}
server-1 TypeError: Cannot create property 'path' on string 'localhost'
server-1 at createClient (/usr/local/apps/projecto/node_modules/redis/lib/createClient.js:62:26)
server-1 at Object.exports.createClient (/usr/local/apps/projecto/node_modules/redis/index.js:1081:41)
server-1 at internals.Connection.start (/usr/local/apps/projecto/node_modules/catbox-redis/lib/index.js:46:24)
server-1 at internals.Client.start (/usr/local/apps/projecto/node_modules/hapi/node_modules/catbox/lib/client.js:41:21)
server-1 at each (/usr/local/apps/projecto/node_modules/hapi/lib/server.js:247:36)
server-1 at Object.exports.parallel (/usr/local/apps/projecto/node_modules/hapi/node_modules/items/lib/index.js:70:13)
server-1 at internals.Server.initialize (/usr/local/apps/projecto/node_modules/hapi/lib/server.js:251:11)
server-1 at internals.Server.start (/usr/local/apps/projecto/node_modules/hapi/lib/server.js:182:10)
server-1 at Object.<anonymous> (/usr/local/apps/projecto/dist/webpack:/app/app.js:119:8)
server-1 at __webpack_require__ (/usr/local/apps/projecto/dist/webpack:/webpack/bootstrap c4781f2bce8764d4cada:19:1)
This is my app.js setup:
const server = new Hapi.Server({
debug: {
request: ['error']
},
cache: {
name: 'redisCache',
engine: CatBox,
// host and port must be commented out to avoid the error
host: process.env.redisHost,
port: process.env.redisPort
// No errors when "options" is uncommented
// options: {
// host: process.env.redisHost,
// port: process.env.redisPort
// }
}
});
server.connection({
host: process.env.serverHost,
port: process.env.serverPort
});
// redis cache
server.app.cache = server.cache({
cache: 'redisCache',
segment: 'seg',
expiresIn: 604800000 // 1 week
});
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
lockbot
locked as resolved and limited conversation to collaborators
Jan 9, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Originally from outmoded/hapijs.com#407
I encounter a stacktrace when host and port aren't used on an
options
property.In the Client subsection of http://hapijs.com/tutorials/caching, this configuration code example is given:
I am only able to get this to work with an options property:
This is the stacktrace I get when I try using host and port directly on cache: {}
This is my app.js setup:
And my package.json dependencies
One thought is that the babel es6 transpiling is doing something that catbox doesn't like.
The text was updated successfully, but these errors were encountered: