3

I am trying to import my ts file on some js file, when I am doing deploy I am getting error:

Error: Error parsing triggers: Cannot find module 'EmailData'

My code:

the js file:

var EmailDataClass = require("EmailData");

the ts file:

class EmailData {}
export EmailData;
3
  • Where are you putting your module? In the node_modules directory? Should look like : myFirebaseApp/functions/node_modules/EmailData/index.ts
    – James Poag
    Commented May 30, 2017 at 13:48
  • node_modules if for npm packages and my files on the same folder as index... Commented May 30, 2017 at 14:02
  • Firebase does not automatically interpret or transpile typescript. You'll have to transpile it yourself and deploy the resulting JavaScript module to Cloud Functions. See stackoverflow.com/questions/42973741/… Commented May 30, 2017 at 14:16

1 Answer 1

1

good introduction: link node_modules folder. But only the index.js file is executed, you can reconfigure a main file through the main field of functions/package.json. You can see the source code from link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.