question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RedisStore - TypeError: Cannot read property 'data' of undefined

See original GitHub issue

Using Redis store to get, set,remove. And i see below exception

err: TypeError: Cannot read property 'data' of undefined at t.adapter (/node_modules/axios-cache-interceptor/cjs/index.js:1:3074)

I do not see cjs/index.js in [axios-cache-interceptor](https://github.com/arthurfiorette/axios-cache-interceptor) repo

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:40 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
CiprianDraghicicommented, Mar 24, 2022

@arthurfiorette I figured the same issue but using localStorage. What I observed is having multiple gets to the same endpoint with a custom id and invalidating the request by id before executing the next to get request, then this error occurred. Probably because the code expects to have the request already cached. But I expect that if the request is not cached then do the original request to DB. I also observed that when this error appears all the following requests will fail and checking the network I observed that no request is made.

1reaction
arthurfiorettecommented, Mar 11, 2022

Well, I’m don’t know much about different redis instructions, there’s any major difference?

Also, how we can generate a custom key for custom storage, so that in tests i can look for that key

// You can force custom keys:
// https://axios-cache-interceptor.js.org/#/pages/per-request-configuration?id=id
const response = await axios.get('url', {
  id: 'custom key'
});

// Or get what id was used:
// https://axios-cache-interceptor.js.org/#/pages/response-object?id=id
const usedIdForThisRequest = response.id;

Went to read the documentation and it isn’t good. I guess that i’ll have to rewrite a lot of things today 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

RedisStore - TypeError: Cannot read property 'prototype' of ...
Something is undefined, that is explicitly calling .prototype... . Double-check all the modules are installed, and then search your code for " ...
Read more >
v1.5.0 - Cannot read property 'prototype' of undefined ... - GitHub
I get this error on version 1.5 of redis-connect. /data/code/temp/nss-cohort-iv-integrated-template/node_modules/connect-redis/lib/connect- ...
Read more >
Cannot read property 'prototype' of undefined” (NodeJS ...
This post outlines a solution that worked for the author when the web application creating using NodeJS, ExpressJS and Redis failed to start ......
Read more >
TypeError: Cannot read property 'facts' of undefined-node.js
The error indicates that the variable item is undefined. This is probably because you are going out of bounds of the gameChanger array,...
Read more >
How to Manage Session using Node.js and Express
After creating Session variables like sess.email , we can check whether this variable is set or not in other routers and can track...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found