Guides
Retool Firebase Raw Mode Error: Cannot Find Module Firestore
If you're hitting Error: Cannot find module '@google-cloud/firestore/build/src/path' in your Retool app while using Firebase raw mode, this guide explains exactly what's going on, why GUI mode still works, and what steps to take while you wait for a fix. The Retool Firebase raw mode cannot find module firestore error is a known platform-level issue — not a bug in your code — and it has knocked out production apps more than once.
What Is Raw Mode in Retool's Firebase Resource?
Retool's Firebase integration offers two ways to query your data: GUI mode and raw mode. GUI mode provides a point-and-click interface for common Firestore operations like reading a document or listing a collection. Raw mode lets you write JavaScript directly against the Firebase SDK, giving you full control over complex queries — nested subcollections, chained .collection() and .doc() calls, transactions, and more.
A typical raw mode query looks like this:
const fetchPurchasedVehicle = db.firestore().collection(collectionName1).doc(docName1).collection(subCollectionName2).doc(docName2).get();
Raw mode is essential when GUI mode's options aren't expressive enough. That's exactly why this error is so disruptive — it breaks the more powerful path entirely.
Why Does the "Cannot Find Module Firestore" Error Happen?
The root cause is a missing or broken JavaScript package on Retool's backend. When Retool deploys a new version of its platform, the @google-cloud/firestore package — or a specific internal build path within it — can go missing from the server environment that executes raw mode queries. GUI mode avoids this because it uses a different, more abstracted internal code path that doesn't depend on the same module resolution.
In short: your Firebase credentials are fine, your resource connection is fine (the test connection passes), and your JavaScript is fine. The problem is that Retool's execution environment is temporarily missing a dependency it needs to run your code.
This is confirmed by the pattern in the community thread: test connection succeeds, GUI mode works, but raw mode throws the module error consistently across different Firebase resources and environments.
How to Tell If You're Affected
- Your Firebase resource shows a successful test connection in the Retool resource settings.
- Queries running in GUI mode return data correctly.
- Switching the same query to raw mode produces
Error: Cannot find module '@google-cloud/firestore/build/src/path'. - The error appears across multiple apps and environments, not just one query.
- No recent changes to your Firebase config or Retool resource settings preceded the error.
If all of the above apply, you're looking at a platform-level incident, not a configuration mistake.
Temporary Workarounds While You Wait for a Fix
Because this is a server-side package issue, there's no client-side code change that will resolve it. However, here are the best options to reduce impact on your end users:
- Switch to GUI mode temporarily. For simple document reads or collection queries, GUI mode can cover the use case without raw JavaScript. Rebuild the query using the GUI dropdowns and fields until the fix is deployed.
- Route Firestore calls through a middleware API. If your raw mode query is too complex for GUI mode, consider exposing the Firestore operation through a lightweight backend endpoint (Cloud Functions, a Next.js API route, or any REST API). Point a Retool REST resource at that endpoint instead.
- Contact Retool support immediately. Flag the issue as production-impacting. In past incidents, Retool's engineering team has performed a rollback to a stable version once enough reports came in. The faster they know, the faster the rollback happens.
- Check the Retool status page. Visit Retool's official status page to see if an incident has already been acknowledged. If it has, subscribe to updates so you know the moment it's resolved.
What Retool Does to Fix It
Based on the community thread, Retool's standard response to this class of error is to roll back the platform to a previous stable version. The engineering team investigates the missing JS package, identifies the deployment that introduced the regression, and reverts it. Resolution time in past incidents has ranged from a few hours to within the same business day once the issue is escalated as a platform incident.
After the fix is deployed, raw mode queries using db.firestore() chained calls will work again without any changes on your end.
How to Prevent Disruption in the Future
- Build critical Firestore logic into a backend service rather than relying solely on Retool raw mode. This gives you a fallback path and makes your internal tool more resilient to platform changes.
- Set up a Retool query health check — a simple scheduled query that pings a known Firestore document and alerts your team via Slack if it fails. You'll catch regressions before end users do.
- Follow the Retool changelog and community forum for deployment notices. Platform updates that touch JS package versions are the most common trigger for this class of error.
Summary
The Cannot find module '@google-cloud/firestore/build/src/path' error in Retool Firebase raw mode is caused by a missing server-side package following a platform deployment — not by anything in your app or Firebase configuration. GUI mode continues to work because it uses a different internal path. Your best immediate options are to switch affected queries to GUI mode, proxy Firestore calls through an external API, and report the issue to Retool support to trigger a rollback. Once Retool reverts to a stable version, raw mode returns to normal with no action required on your part.
Ready to build?
We scope, design, and ship your Retool app — fast.