george43g / better-firebase-functions

This repo provides functionality for a better way of organising files, imports and function triggers in Firebase Cloud Functions
Mozilla Public License 2.0
179 stars 15 forks source link

Is this repository unattended? Error generating function names within nested folders #24

Closed rskinnerc closed 2 years ago

rskinnerc commented 3 years ago

I've been working with Firebase functions and using this package which is awesome. However, I'm facing an issue now, when you use nested folder structure:

image

The emulator throws an error ! Error adding trigger: FirebaseError: HTTP Error: 404, Not Found

and within the log you can find

INFO: Unknown request URI: /emulator/v1/projects/myfirebaseproject/triggers/db-users/onCreate-0

As you can see the generated function does not correspond to the structure, it should generate db-users-onCreate which is not the case.

Thing is, I found some other issues like this, which are not being attended. Actually the repo's last commit was 11-17 months ago. I'm wondering if its being deprecated or?

ivan416 commented 3 years ago

Experiencing the same issue. Looks like there is a fix but it has not been merged.

The workaround in the meantime could be to use only one folder depth. For example, instead of src/db/users/on-create.ts switch to src/db/on-create-user.ts.

cgossain commented 3 years ago

FYI –

I tried that fix and it's working for me.

As a workaround, until this is merged, I had to manually copy/re-implement the function in the referenced PR, and pass it in the funcNameFromRelPath parameter of the exportFunctions() function.

For some reason referencing, the PR fix branch directly in npm was failing to deploy to Google Cloud.

For what it's worth, I'd love to see that PR merged!

george43g commented 3 years ago

Hey guys - I will get all these updates merged tonight. I've had to take a little sabbatical from this over the last few months and didn't get notified by the new issues that had opened for some reason. I'll be updating both the medium articles and the code repo as well. With newer versions of node, there are some features that may prompt an entire rewrite of this repo to keep it fast/clean.

hamishjohnson commented 2 years ago

@george43g did you manage to merge the updates? the PR is still open

george43g commented 2 years ago

Closing this issue now - this repo was unattended for about a year or so, but is now attended again. The above issue has been fixed and merged into the repo