-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebase-functions v4 breaks better-firebase-functions: No functions are detected during deployment #47
Comments
I've not yet had a chance to investigate this - had to take the last few months off work. I need to investigate how useful this repo is given that Firebase Functions now supports ESM modules ( |
I have the same problem as bhr and would very much appreciate a disclaimer in the README. |
I've tested with v4 and it works for me - however my whole dir is compiled with webpack before deployment (shouldn't change things) - I'll investigate further what's causing the issue. |
For me after upgrading from |
Btw, I downgraded back to 4.0.0 and it's working again. Also v2 functions seem to not get picked up properly with this lib, I was hoping to upgrade to 6.0.0 in case it was fixed there. |
Just short on time - if anyone can diagnose the issues and make a PR, that
would be great. Otherwise I’ll get around to it as soon as I can.
G
…On Wed, 4 Oct 2023 at 12:22 pm, Christian Gossain ***@***.***> wrote:
Btw, I downgraded back to 4.0.0 and it's working again.
Also v2 functions seem to not get picked up properly with this lib, I was
hoping to upgrade to 6.0.0 in case it was fixed there.
—
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUEHPRWZBX2OTKRQSHOSW3X5S26TAVCNFSM6AAAAAARJ7Y7U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBVHE4DINRWGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Same problem for me -- no functions are being detected. I tried figuring out what the problem was, but am struggling to figure it out |
Experiencing the same issue. Downgrading to 4.0.0 resolves it for both v1 and v2 functions. |
Likewise here. |
Has anyone figured out why version 4 works while the newer ones doesn't
work?
…On Thu, 11 Apr 2024 at 10:06 pm, Simon Zimmerman ***@***.***> wrote:
Experiencing the same issue. Downgrading to 4.0.0 resolves it for both v1
and v2 functions.
Likewise here.
—
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUEHPVPMUZFFAQDRXYJEKDY4Z4FBAVCNFSM6AAAAAARJ7Y7U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBZGU2DSNBUGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Just don't use this library, it has been abandoned. No point in having your plan rely on it. |
Issue is not reproducible and I haven't seen anyone else attempt a PR with
a fix yet. I only have so much time to contribute to this these days
G
…On Fri, 12 Apr 2024 at 12:35 am, Andrew Vittiglio ***@***.***> wrote:
Just don't use this library, it has been abandoned. No point in having
your plan rely on it.
—
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUEHPUF6X2AJQUJN56G37DY42NR3AVCNFSM6AAAAAARJ7Y7U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBZHAZTSNBYGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I got the issue as well, I cloned the project locally to debug and found out the glob matching couldn't find the files. I made the following change and it fixed. exportFunctions({
__filename,
exports,
enableLogger: true,
+ searchGlob: '**/*.js',
}); Now I see: 👍
Something else might be going on since this doesn't seem like something that would change between firebase versions? |
Wow that’s a weird one. I remember writing it in TS but using wallaby to
debug live / performance test it - so wrote the default glob to match both
ts files and js files, depending on the environment (eg ts-node would
return ts file extensions) you may need the glob to cover both cases.
At some point there was a compile or node version compatibility error (or
maybe security patch, this was a while ago, could check the commit history)
where the glob version was updated. Might be a breaking change with glob -
but the best default value imho should match both ts and js (its not regex
but glob notation).
Is it possible newer version of glob had a breaking change with glob
notation?
G
…On Thu, 18 Apr 2024 at 8:40 am, Kyle Smith ***@***.***> wrote:
I got the issue as well, I cloned the project locally to debug and found
out the glob matching couldn't find the files.
I made the following change and it fixed.
exportFunctions({
__filename,
exports,
enableLogger: true,+ searchGlob: '**/*.js',
});
Now I see: 👍
functions: Loaded functions definitions from source: ...
functions[us-central1-...]: firestore function initialized.
Something else might be going on since this doesn't seem like something
that would change between firebase versions?
—
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUEHPVDUIDNDVSM5JTSQADY5325DAVCNFSM6AAAAAARJ7Y7U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRSGU4TOMBVG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I’ve also had questions regarding jsm / export/import syntax thats now
natively supported by node. As this is also a performance solution, I
haven't benchmarked if native import X from Y beats the classic require().
Functions and sub function group detection is built to work identically to
how FF used to do it, which was simply reading the main entry point’s
module.exports object. If this has changed, it may be related to the issue
and warrant further updates.
I personally use webpack to compile, minify and have its own runtime to
squeeze in dependencies into the same js function file (saves on js
parse/eval time) but separated per function (used the entry points feature
of webpack to achieve this. So you’d still output separate js for each
function to minimise how much js is parsed in cold start and only load the
dependencies needed for that particular function invocation, and keep it in
global scope while the function is warm.
I never got a chance to publish the webpack plugin that goes with this - I
didnt want to include it in this bundle as again, for performance I keep
the bundle as small as possible with minimal external dependencies.
Its been a few months since I checked the latest of the js ecosystem -
would users want this as well (as its a further speedup) or would it need
compatibility with multiple bundlers that are also popular nowadays? At the
time Firebase didnt have any docs on bundling or compiling your functions
directory but it works and does lead to further performance improvements.
G
…On Thu, 18 Apr 2024 at 10:19 am, George G ***@***.***> wrote:
Wow that’s a weird one. I remember writing it in TS but using wallaby to
debug live / performance test it - so wrote the default glob to match both
ts files and js files, depending on the environment (eg ts-node would
return ts file extensions) you may need the glob to cover both cases.
At some point there was a compile or node version compatibility error (or
maybe security patch, this was a while ago, could check the commit history)
where the glob version was updated. Might be a breaking change with glob -
but the best default value imho should match both ts and js (its not regex
but glob notation).
Is it possible newer version of glob had a breaking change with glob
notation?
G
On Thu, 18 Apr 2024 at 8:40 am, Kyle Smith ***@***.***>
wrote:
> I got the issue as well, I cloned the project locally to debug and found
> out the glob matching couldn't find the files.
>
> I made the following change and it fixed.
>
> exportFunctions({
> __filename,
> exports,
> enableLogger: true,+ searchGlob: '**/*.js',
> });
>
> Now I see: 👍
>
> functions: Loaded functions definitions from source: ...
> functions[us-central1-...]: firestore function initialized.
>
> Something else might be going on since this doesn't seem like something
> that would change between firebase versions?
>
> —
> Reply to this email directly, view it on GitHub
> <#47 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ACUEHPVDUIDNDVSM5JTSQADY5325DAVCNFSM6AAAAAARJ7Y7U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRSGU4TOMBVG4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
After updating to
firebase-functions 4.0.1
and trying to deploy the functions, firebase doesn't find any cloud functions anymore. It shows the following error:index.ts
With
firebase-functions 3.24.1
deployment works and the functions are picked up correctly.The transpiled JS files look as expected and correctly use
exports.default
Sample function (TS->JS)
Is there any way to debug what's going wrong?
The text was updated successfully, but these errors were encountered: