nx-firebase: Functions that use local libraries do not deploy with Firebase Node 12 engine

Firebase Node 12 support uses npm ci rather than npm install - which requires a package-lock.json which the plugin does not generate. This could be a problem. Need to check. https://cloud.google.com/functions/docs/migrating/nodejs-runtimes#nodejs-12-changes

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (12 by maintainers)

Most upvoted comments

Folks, I’m looking into the node12 support atm, but it might take a couple of weeks to complete.

Not sure where you have got to with this, but I just encountered an issue with deploying when I created a 2nd lib ‘their-lib’ which ‘my-lib’ depended on. Removing the dependency and the lib stopped the error from occurring.

Thanks @simondotm for this awesome library. I ran into the same issue with Node12. Downgrading to Node10 fixes the issue and as your mentioned don’t see any issues with using the Node10 issue

Yeah can confirm that changing to node 10 stops the deploy error for me, thanks 😃

Ah ok, that pretty much confirms my suspicions then. I’ll need to update the plugin to modify the package.json for each dependent lib that depends on another local lib. Give me a couple of days to see if I can get this sorted.

not using nx - there is an issue currently with firebase (https://github.com/firebase/firebase-tools/issues/968) to do with the deploy step failing when using local depencies with npm - there are some workarounds at the bottom of the thread - that may not be relevant here though

@simondotm no worries, my codebase is very simple at the moment, I have one app ‘functions-app’ which has the ‘helloWorld’ cloud function which this package generates. And one lib ‘my-lib’ the boilerplate lib generated from ‘nx g @nrwl/node:lib my-lib --buildable’. I have then imported that lib and added the string from ‘my-lib’ to the logging in the ‘helloWorld’ function.

not sure if that is useful information - let me know if you need any info when you look at it

I was able to deploy a cloud function to a project using Node 12 where a shared lib is imported. There is no package-lock.json in my app directory nor my library directory. What conditions is this error happening for you?