Grpc error when running node.js and firebase


#1

I am getting the below error when I am trying to run a node.js app with the firebase NPM package.

27.12.18 11:31:41 (-0500) main /usr/src/app/node_modules/@firebase/firestore/node_modules/grpc/src/grpc_extension.js:57
27.12.18 11:31:41 (-0500) main throw e;
27.12.18 11:31:41 (-0500) main ^
27.12.18 11:31:41 (-0500) main
27.12.18 11:31:41 (-0500) main Error: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9’ not found (required by /usr/src/app/node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc/grpc_node.node)
27.12.18 11:31:41 (-0500) main at Object.Module._extensions…node (internal/modules/cjs/loader.js:718:18)
27.12.18 11:31:41 (-0500) main at Module.load (internal/modules/cjs/loader.js:599:32)
27.12.18 11:31:41 (-0500) main at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
27.12.18 11:31:41 (-0500) main at Function.Module._load (internal/modules/cjs/loader.js:530:3)
27.12.18 11:31:41 (-0500) main at Module.require (internal/modules/cjs/loader.js:637:17)
27.12.18 11:31:41 (-0500) main at require (internal/modules/cjs/helpers.js:20:18)
27.12.18 11:31:41 (-0500) main at Object. (/usr/src/app/node_modules/@firebase/firestore/node_modules/grpc/src/grpc_extension.js:32:13)
27.12.18 11:31:41 (-0500) main at Module._compile (internal/modules/cjs/loader.js:689:30)
27.12.18 11:31:41 (-0500) main at Object.Module._extensions…js (internal/modules/cjs/loader.js:700:10)
27.12.18 11:31:41 (-0500) main at Module.load (internal/modules/cjs/loader.js:599:32)

Apparently a possible fix is to install libstdc++6, but it doesn’t seem to be possible for BalenaOS.

Any ideas on how to get firebase working on BalenaOS?
I am not even using the firestore portion of firebase (only the RT database), but it appears everything gets loaded regardless.


#7

@RexChiu,

the way I see it you do not have to install libstdc++6 in balenaOS. It only has to be present in your container.
So if you are using a Dockerfile in your project, you can just install libstdc++6 from within the Dockerfile.

FROM node:10-stretch

RUN apt-get update && apt-get -y install libstdc++6

...

Please reach out to us if that does not work for you.


#9

I got the Dockerfile working, with the suggested additions.

FROM resin/raspberrypi3-node

RUN apt-get update && apt-get -y install libstdc++6

RUN apt-get upgrade

RUN apt-get dist-upgrade

COPY package.json /package.json

RUN npm install

COPY src/ /usr/src/app

CMD [“node”, “/usr/src/app/index.js”]

However I am still getting the same error below. This is weird as I used to run my Node.js app on Rasbian without issues.

27.12.18 21:21:15 (-0500) main /node_modules/@firebase/firestore/node_modules/grpc/src/grpc_extension.js:57
27.12.18 21:21:15 (-0500) main throw e;
27.12.18 21:21:15 (-0500) main ^
27.12.18 21:21:15 (-0500) main
27.12.18 21:21:15 (-0500) main Error: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9’ not found (required by /node_modules/@firebase/firestore/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc/grpc_node.node)
27.12.18 21:21:15 (-0500) main at Object.Module._extensions…node (internal/modules/cjs/loader.js:718:18)
27.12.18 21:21:15 (-0500) main at Module.load (internal/modules/cjs/loader.js:599:32)
27.12.18 21:21:15 (-0500) main at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
27.12.18 21:21:15 (-0500) main at Function.Module._load (internal/modules/cjs/loader.js:530:3)
27.12.18 21:21:15 (-0500) main at Module.require (internal/modules/cjs/loader.js:637:17)
27.12.18 21:21:15 (-0500) main at require (internal/modules/cjs/helpers.js:20:18)
27.12.18 21:21:15 (-0500) main at Object. (/node_modules/@firebase/firestore/node_modules/grpc/src/grpc_extension.js:32:13)
27.12.18 21:21:15 (-0500) main at Module._compile (internal/modules/cjs/loader.js:689:30)
27.12.18 21:21:15 (-0500) main at Object.Module._extensions…js (internal/modules/cjs/loader.js:700:10)
27.12.18 21:21:15 (-0500) main at Module.load (internal/modules/cjs/loader.js:599:32)