Firebase Functions interprets reified types as method export when cross compile Kotlin/JS

Hey community,

I am just working on a Kotlin project, which deploys the source code to Firebase Functions. It works very well with Ktor and Kodein, except for the inline methods with a reified type.

Since _ is module.exports, the project is exporting the auto-generated $importsForInline$.index function as _. Since $importsForInline$ is not a cloud function, exporting it causes to an error.

Maybe one of you finds a way to overcome this problem. Thanks a lot!

This is the error:

`Error: Error occurred while parsing your function triggers. Please ensure that index.js only exports cloud functions.`

The issue occurs through following source code:

  var $importsForInline$ = _.$importsForInline$ || (_.$importsForInline$ = {});
  $importsForInline$.index = _;

The full Kotlin source code is here:

This is the auto-generated code to deploy:

Hi there!,

I noticed the inline keyword is adding the method to the exports as well. To workaround this, you can create separate Gradle module that contains the inline functions you defined. Next link it up as a dependency: implementation(project("firebase utils")). Be sure you include the newly created module to the folder that you upload to firebase (see: Handling dependencies  |  Cloud Functions for Firebase).

Thank you very much. I will try it!