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.

TypeError: Cannot read property 'concat' of null

See original GitHub issue

I keep getting the following error in my nodejs application. I am using node v8.11.1 and grpc v1.11.3. The same code was working fine a few days ago.

    TypeError: Cannot read property 'concat' of null
        at Object.getInterceptingCall (/home/dipu/projects/tee/node_modules/grpc/src/client_interceptors.js:1376:39)
        at ServiceClient.Client.makeUnaryRequest (/home/dipu/projects/tee/node_modules/grpc/src/client.js:471:47)
        at apply (/home/dipu/projects/tee/node_modules/lodash/lodash.js:478:17)
        at ServiceClient.wrapper (/home/dipu/projects/tee/node_modules/lodash/lodash.js:5337:16)
        at Promise (/home/dipu/projects/tee/node_modules/grpc-promisify/src/index.js:22:26)
        at new Promise (<anonymous>)
        at ServiceClient.client.(anonymous function) [as getTeeFeed] (/home/dipu/projects/tee/node_modules/grpc-promisify/src/index.js:21:14)
        at Object.shadowClient.(anonymous function) [as getTeeFeed] (/home/dipu/projects/tee/build/webpack:/server/helper/grpc-client.js:40:27)
        at /home/dipu/projects/tee/build/webpack:/server/api/contents.js:31:33
        at Layer.handle [as handle_request] (/home/dipu/projects/tee/node_modules/express/lib/router/layer.js:95:5)
        at next (/home/dipu/projects/tee/node_modules/express/lib/router/route.js:137:13)
        at Route.dispatch (/home/dipu/projects/tee/node_modules/express/lib/router/route.js:112:3)
        at Layer.handle [as handle_request] (/home/dipu/projects/tee/node_modules/express/lib/router/layer.js:95:5)
        at /home/dipu/projects/tee/node_modules/express/lib/router/index.js:281:22
        at Function.process_params (/home/dipu/projects/tee/node_modules/express/lib/router/index.js:335:12)
        at next (/home/dipu/projects/tee/node_modules/express/lib/router/index.js:275:10)

EDIT: I updated from grpc v1.7.3. After I reverted back to old package-lock.json the error was fixed. But still a question remains: why this error happened?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
drobertdukecommented, May 8, 2018

@murgatroid99 The client constructor ensures that client[functionName].interceptors is an array, which ensures all those other calls return arrays https://github.com/grpc/grpc-node/blob/master/packages/grpc-native-core/src/client.js#L391

@dipu-bd You are using a grpc-promisify library which clobbers the client[functionName] function, removing the interceptors attribute https://github.com/leaves4j/grpc-promisify/blob/master/src/index.js#L14

I can update the signatures of the private methods to only return arrays but the immediate fix here is to not clobber client[functionName], and if you do, reattach .interceptors.

0reactions
murgatroid99commented, May 11, 2021

The grpc package has been deprecated. We recommend using @grpc/grpc-js instead. That library has a different interceptor implementation, which shouldn’t have these issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'concat' of Undefined in JS
The "Cannot read property 'concat' of undefined" error occurs when the concat() method is called on an undefined value. To solve the error,...
Read more >
TypeError: Cannot read property 'concat' of undefined
My problem is that when i run my project it gives me an error that says: TypeError: Cannot read property 'concat' of undefined....
Read more >
TypeError: Cannot read property 'concat' of undefined
Description of the problem: When I run my experiment I get an error which says, 'TypeError: Cannot read property 'concat' of undefined'.
Read more >
Uncaught TypeError: Cannot read property 'concat' of undefined
Hi,. I got an error message in the through the developer console inspection. https://imgur.com/a/IXwkK2l. Uncaught TypeError: Cannot read property 'concat' ...
Read more >
[Solved]-Can not read property 'Concat' of Undefined-Chart.js
[Solved]-Can not read property 'Concat' of Undefined-Chart.js ... You would have to set the chart type in the main chart option, not inside...
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