ERROR: Could not resolve "assert", "stream", "url" when deploy app that uses @google-cloud/firestore to Vercel

Environment details

  • Vercel Node.js version: 18x
  • Package manager: Bun 1.1.7
  • @google-cloud/firestore version: ^7.9.0

Steps to reproduce

  1. Install and use @google-cloud/firestore
  2. Deploy my SvelteKit app to Vercel
  3. Deployment will fail with this error. Note I’m not using edge functions
error during build:
Error: Build failed with 78 errors:
node_modules/@google-cloud/firestore/build/src/aggregate.js:20:23: ERROR: Could not resolve "assert"
node_modules/@google-cloud/firestore/build/src/bulk-writer.js:4:23: ERROR: Could not resolve "assert"
node_modules/@google-cloud/firestore/build/src/document.js:20:23: ERROR: Could not resolve "assert"
node_modules/@google-cloud/firestore/build/src/index.js:19:25: ERROR: Could not resolve "stream"
node_modules/@google-cloud/firestore/build/src/index.js:20:22: ERROR: Could not resolve "url"

Hi, @juniorforlife!

I wonder if there’s an issue with incompatibility of the @google-cloud/firestore package and Bun. It looks like there may be missing Node.js core modules. You could try switching to a different package manager, e.g. npm or yarn?

Thanks for your suggestion. I’ll try using NPM

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.