Firebase-tools: Functions Emulator fails to emulated nested exports

Created on 29 Sep 2017  Â·  5Comments  Â·  Source: firebase/firebase-tools

> firebase experimental:functions:shell fails at emulating functions organized in sub-folder

Version info

3.12.0

Steps to reproduce

Organize function src in a modular way as above

in /functions/index.js :

const functions = require('firebase-functions');
exports.builder = require('./src/builder/index');

in functions/scr/builder/index.js :

const functions = require('firebase-functions');
const doBuild = require('./listener');

const buildListenerPath = '/build/buildRequest/{uid}/survey/{id}/{lan}/timestamp';
exports.doBuild = functions.database.ref(buildListenerPath).onWrite(doBuild);

and run firebase experimental:functions:shel

Expected behavior

builder-doBuild is emulated

Actual behavior

console produces

âš   functions: Failed to emulate Error

However this works as expected:

const builder = require('./src/builder/index');
exports.doBuild = builder.doBuild;

Most helpful comment

This still seems to be a problem.

All 5 comments

- seems to be the issue.

exports.send-otp-sms = otpHelper.send_otp_sms; this fails but

exports.sendOtpSms = otpHelper.send_otp_sms; this works

@laurenzlong any update on this issue?

Hey @hariprasadiit this is still on our radar, and @tinaliang will be working on it.

This still seems to be a problem.

This feature has been integrated in #677 , so I will be closing this issue.

Was this page helpful?
0 / 5 - 0 ratings