firebase-functions-typescript-starter icon indicating copy to clipboard operation
firebase-functions-typescript-starter copied to clipboard

Importing a file from outside functions create error at build

Open blaforet opened this issue 6 years ago • 1 comments

Hi

In my main project have a generic common.ts file where I put some functions and constants. If I import this file into the functions, the "run deploy" does not work. It creates some build error and screws up the lib directory. It no longer updates the lib\index.js instead, it creates a new subfolder lib\functions\ and put everything there, like if it was the lib folder.

Therefore I need to duplicate my common.ts file and update it every time that I do change in the functions. It's not the best practice especially if I forget.

Any suggestion? Thank you Benoit L.

blaforet avatar Mar 25 '18 17:03 blaforet

Hi @blaforet,

I don't know a solution for this behaviour. It seems to be by design, see for example here: https://github.com/Microsoft/TypeScript/issues/16683 and here: https://github.com/Microsoft/TypeScript/issues/8245

robisim74 avatar Mar 25 '18 22:03 robisim74