Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error parsing triggers: Cannot find module

I am trying to deploy my firebase function to cloud but getting an error:

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

1.I compile my ts file to js.

2.the build of ts ok... my code looks like:

the ts that importing the file...

var EmailDataClass = require("EmailData");

and the file it self:

class EmailData {....
}export = EmailData;
✔  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...

Error: Error parsing triggers: Cannot find module 'EmailData'
like image 791
Vitaly Menchikovsky Avatar asked Aug 15 '26 19:08

Vitaly Menchikovsky


1 Answers

It's not recommended to use mix of Typescript & ES6 export and import methods

it's better to use type script import

import { EmailDataClass } from "./EmailData";

And to Export use

export class EmailData {....
}
like image 148
OBender Avatar answered Aug 18 '26 09:08

OBender



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!