Web stop sending requests to API, Failed to load gRPC binary module

Hello all,

Our web stopped sending requests to our API yesterday, and I just caught the issue. We have a query that is hitting /.netlify/functions and returning some prices, you can see it here. If I inspect the error I can see this

Runtime.ImportModuleError: Error: Failed to load gRPC binary module because it was not installed for the current system

Expected directory: node-v93-linux-x64-glibc

Found: [node-v83-linux-x64-glibc]

This problem can often be fixed by running "npm rebuild" on the current system

Original error: Cannot find module '/var/task/node_modules/grpc/src/node/extension_binary/node-v93-linux-x64-glibc/grpc_node.node'

Require stack:

- /var/task/node_modules/grpc/src/grpc_extension.js
- /var/task/node_modules/grpc/src/client_interceptors.js
- /var/task/node_modules/grpc/src/client.js
- /var/task/node_modules/grpc/index.js
- /var/task/functions/fairValues/api/index.js
- /var/task/functions/fairValues/fairValues.js
- /var/task/fairValues.js
- /var/runtime/index.mjs

at _loadUserApp (file:///var/runtime/index.mjs:726:17)
at async Object.module.exports.load (file:///var/runtime/index.mjs:741:21)
at async file:///var/runtime/index.mjs:781:1
at async file:///var/runtime/index.mjs:4:1

I’ve specified the new build env variable as AWS_LAMBDA_JS_RUNTIME and the value is nodejs14.x, because I’m not planning on switching to node16, but that didn’t fix the issue.

grpc version is an old version, but that was working properly until yesterday. Any thoughts??

I have solved this problem by adding the missing NODE_VERSION env variable to and rebuilding the project.

1 Like

Thanks so much for coming back and sharing your solution with us! This will definitely be beneficial to future members who encounter something similar.

Happy building :rocket: