Click here to Skip to main content
15,747,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have below code snippet which is giving me an error. I am getting a response back from getFilteredList which is of lenght 1 and it has a proper json data. But not sure why its giving error.

TypeError: Cannot read property 'then' of null

getFilteredList(group, feature).then(r=>{ //here I am getting error. 
    if( == "1")
      const columnName = "ColumnName";
      const Codes = => x[columnName]);
      Codes.forEach(code => {
        let store = getStoreValue(code);
        getDetailsById(id, datastore)
          parseError(e, res);
      parseError(e, res);

What I have tried:

getFilteredList() a another node js service which is returning a data when I tested it using Saop UI. I can see it in logs as well of application. I am not getting why it is saying null though having a data
Below is sample data it returns.
Updated 13-Feb-20 3:26am

1 solution

getFilteredList(group, feature).then(r=>{

The message simply means that the call to getFilteredList does not return anything.
Share this answer
Telstra 13-Feb-20 9:01am    
But this same call is working in my one more node js service where this call is returning a data.
getDetailsById(adgroup, featureSet).then(r=>{ -- this line is working fine here.
if( == "1") -- this condition is working fine.
Richard MacCutchan 13-Feb-20 9:09am    
Sorry I copied the wrong line of your question; see updated code above. You need to use your debugging tools to find out why it does not return anything.
Telstra 13-Feb-20 9:11am    
getFilteredList() is another node js service which itself returns json data and I can see that data in logs. Below is the data it returns.

F-ES Sitecore 13-Feb-20 9:58am    
You might think that is what it is returning, but it isn't, it is returning null, ergo the error.
Telstra 13-Feb-20 10:16am    
I got that response from logs and I can see that in json string variable as well from getFilteredList() service.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900