Help with error using redis on middleware - (middleware)/node_modules/redis-errors/index.js (3:0) @ <unknown> #54469
Unanswered
ericchaves
asked this question in
Help
Replies: 3 comments 7 replies
-
@ericchaves I'm getting the same error. Have you found a solution? |
Beta Was this translation helpful? Give feedback.
1 reply
-
damn hitting exact same issue :X |
Beta Was this translation helpful? Give feedback.
0 replies
-
Same issue here using in middleware |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
HI folks, I'm new to NextJS and I'm facing an error that I can't figure out the reason behind it. I believe I'm misunderstanding how NextJs uses middlewares on server side.
In short, I have a middleware that should execute on my nextjs server for every Page or API request (I'm not using the middleware on the edge ). It needs to recover some application configurations cached on redis and perform some security validations (like evaluate captcha score, check user data on session storage, etc), therefore my middleware import redis module.
When I start the development server, I got a console error messsage because complaingin that redis-error (a dependency of ioredis) is breaking. I tracked the error and indeed this lib checks the value
process.version
and somehow this value does not seem to be set, hence raising the exception.Now here is what I don't get:
so I'm under the impression that I'm missing something here in regards to how middleware can be used.
Someone can give me some help or directions? what am I missing?
Additional information
Once the development server starts, the console show the error:
the browser opens up but immediatly breaks with error:
Beta Was this translation helpful? Give feedback.
All reactions