google / ground-platform

Ground hosted components: Web console, Cloud Functions, db config
http://groundplatform.org
Apache License 2.0
202 stars 80 forks source link

Deploying functions fails on monorepo deps #1871

Closed gino-m closed 3 weeks ago

gino-m commented 3 weeks ago

Deploy fails with Cannot find module '@ground/proto'. This started happening after adding a dependency on @ground/proto to the functions package in https://github.com/google/ground-platform/pull/1821. The same happen when depending on @ground/lib.

gino-m commented 3 weeks ago

Things I've tried (unsuccessfully):

It appears monorepos aren't supported by Firebase (https://github.com/firebase/firebase-tools/issues/653), but it's unclear why the deploy was working when functions was only depending on lib, which is currently the case in master.

gino-m commented 3 weeks ago

but it's unclear why the deploy was working when functions was only depending on lib, which is currently the case in master.

Update: The deploy likely works because the only reference to @ground/lib is in tests.

gino-m commented 3 weeks ago

Using isolate-package as described here works for both root deploy and deploy from functions/. Sending a patch.