Firebase on nextjs getserversideprop not working on netlify

The repo is open and working
Kwameowusu/oskcat (github.com)

{"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '@grpc/grpc-js/package.json'\nRequire stack:\n- /opt/build/repo/node_modules/@firebase/firestore/dist/index.node.mjs","trace":["Runtime.ImportModuleError: Error: Cannot find module '@grpc/grpc-js/package.json'","Require stack:","- /opt/build/repo/node_modules/@firebase/firestore/dist/index.node.mjs","    at _loadUserApp (/var/runtime/UserFunction.js:100:13)","    at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)","    at Object.<anonymous> (/var/runtime/index.js:43:30)","    at Module._compile (internal/modules/cjs/loader.js:999:30)","    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)","    at Module.load (internal/modules/cjs/loader.js:863:32)","    at Function.Module._load (internal/modules/cjs/loader.js:708:14)","    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)","    at internal/main/run_main_module.js:17:47"]}

I have a product cards which has a dynamic route in nextjs. When I click on the product card i get the above error with firebase

But It works on localhost and vercel