Skip to content
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

Missing dependencies when installing with Node 16 #1360

Closed
sizlo opened this issue Feb 8, 2022 · 2 comments
Closed

Missing dependencies when installing with Node 16 #1360

sizlo opened this issue Feb 8, 2022 · 2 comments
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. web

Comments

@sizlo
Copy link

sizlo commented Feb 8, 2022

When trying to use google-auth-library for a react app I am getting lots of errors that indicate missing dependencies. The errors are in the following format:

Module not found: Error: Can't resolve 'buffer' in '/private/tmp/minimal-example/node_modules/buffer-equal-constant-time'

The error messages include details on how to add a polyfill, but after going through each of these and adding the suggested polyfill the library still does not work, outputting the following error to the console:

GET http://metadata.google.internal./computeMetadata/v1/instance net::ERR_NAME_NOT_RESOLVED

Environment details

  • OS: macOs 12.0
  • Node.js version: 16.13.2
  • npm version: 8.1.2
  • google-auth-library version: 7.11.0

Steps to reproduce

  1. Install Node 16.13.2
  2. Create a react app npx create-react-app minimal-example
  3. Enter directory for the created project cd minimal-example
  4. Install google-auth-library npm install google-auth-library --save
  5. Add the following code to ./src/App.js
    const {GoogleAuth} = require('google-auth-library');
  6. Start the development server npm start
  7. Observe errors
@sizlo sizlo added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 8, 2022
@bcoe bcoe added web type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 8, 2022
@bcoe
Copy link
Contributor

bcoe commented Feb 8, 2022

closing in favor of our catch all issue:

googleapis/google-cloud-node#2933


We do not at this time support the browser without some manual work on the user's part (discussed in the issue above). We are, however, looking at adding this functionality.

May I ask what APIs you're hoping to interact with from the frontend?

@bcoe bcoe closed this as completed Feb 8, 2022
@sizlo
Copy link
Author

sizlo commented Feb 8, 2022

@bcoe

I have a frontend react app and backend springboot app as separate services in the same Google App Engine instance. I want to be able to identify users based on their google account so have put an Identity-Aware Proxy in front of these services. This currently works fine for the react app, as the browser can present the login page for the user.

The problem I am trying to solve is being able to communicate from the frontend to the backend. When trying to send requests from the react app to the springboot app they fail with the 401 unauthorized status code. I found this stackoverflow thread which suggested this guide on authenticating with a service account as a way to solve this use case.

Is there a more recommended way to solve my use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. web
Projects
None yet
Development

No branches or pull requests

2 participants