question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using library from a Cloud hosted function

See original GitHub issue

Hi! I’m trying to use the lib from a Node.js hosted function but since it’s a limited environment, some tests are failing, especially in regard to the UserAgent which can’t be written since the lib can’t read the package.json file.

So I get a warning: Could not load package details. The user agent is set to 'User-Agent': 'nexmo-node/UNKNOWN node/UNKNOWN

And I think that’s why I get HTTP 401 error when I want to query the service from a Function while it works on my local machine.

If that’s the case how can I bypass this behavior? Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexLakatoscommented, Jul 17, 2019

It really doesn’t, we’re using the User-Agent to segment usage, not really blocking anything. I still haven’t figured out how to access the package.json in a serverless environment, so I can have consistency.

0reactions
whitetiglecommented, Jul 17, 2019

However my remark regarding User-Agent is still valid: it does not work in that environment. But it seems it really does not matter.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloud Functions client libraries
This page shows how to get started with the Cloud Client Libraries for the Cloud Functions API.
Read more >
Google Cloud Functions include private library - Stack Overflow
I'm looking to write a custom library in node and I'd like to include that with my Cloud Functions. Since this is shared...
Read more >
Use Libraries to Manage Integration Functions
JavaScript libraries provide a means to create and organize JavaScript for use in integrations. Library functions are automatically available for you to ...
Read more >
Handling dependencies | Cloud Functions for Firebase - Google
A function is allowed to use external Node.js modules as well as local data. Dependencies in Node.js are managed with npm and expressed...
Read more >
Cloud Functions for Firebase Sample Library - GitHub
This quickstart sample demonstrates using Cloud Functions triggered by Firebase Realtime Database or Firestore events. The function transforms message text ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found