skip to Main Content

After updating my Firebase dependencies (need new features) i’ve been trying to deploy them without success.

firebase deploy --only functions

Before the update everything worked fine. Here is the Firebase documentation page for logging.

https://firebase.google.com/docs/functions/writing-and-viewing-logs#custom-logs

require("firebase-functions/lib/logger/compat");

Now the logging fails and i cant understand why.

Error: Failed to load function definition from source: Failed to generate manifest from function source: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/logger/compat' is not defined by "exports" in /Users/admin/Desktop/Xxxxxxx Xcode/functions/node_modules/firebase-functions/package.json

I’ve tried to delete and reinstall. Current versions are now.

Node = v16.18.0  
firebase tools = 11.15.0

What could i be missing?

2

Answers


  1. I got it.

    maybe you use [email protected](latest) now.

    from version 4, we can use

    require("firebase-functions/logger/compat");
    

    Edit like this, it worked.

    Login or Signup to reply.
  2. Had the same issue.

    I imported the logger like this before:

    import {log} from 'firebase-functions/lib/logger'
    

    switching it to the following solved the issue for me:

    import {log} from 'firebase-functions/logger'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search