I have 2 firebase functions project: prod
and infra
. infra
needs all the functions of prod
and has some more of its own (i.e. infra
is a strict superset of prod
). The directory structure is roughly:
|---> myDirectory
|---> infra
| |---> functions
| |---> src
| |---> index.js // infra is TS
|---> prod
|---> functions
|---> index.js // prod is JS
How do you import functions from prod
into infra
? I've tried
// myDirectory/infra/functions/index.js
const { functionA } = require('../../prod/functions/index.js');
exports.functionA = functionA;
This works fine on emulators, but I'm getting this error when deploying:
validateEventDocument
Provided module can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module '../../../prod/functions/index.js'