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

angular universal monitoring #58

Closed
mac2000 opened this issue Jan 30, 2018 · 6 comments
Closed

angular universal monitoring #58

mac2000 opened this issue Jan 30, 2018 · 6 comments
Assignees
Labels
api: logging Issues related to the googleapis/nodejs-logging API. type: question Request for information or clarification. Not an issue. web

Comments

@mac2000
Copy link

mac2000 commented Jan 30, 2018

What we are trying to do is to run Angular universal app inside GKE and collect logs to StackDriver

Steps to reproduce

npm i -g @angular/cli
ng new acme -st -sg
cd acme
ng generate universal ssr

angular 5.1 universal

After reproducing all steps we got working universal app, but after trying add logging to it (no matter is it bunyon or winson we always get same error while trying to build app, complayinging:

ERROR in ./node_modules/@google-cloud/logging/src/v2/config_service_v2_client.js
Module not found: Error: Can't resolve './config_service_v2_client_config' in '/Users/mac/dev/mobjs/node_modules/@google-cloud/logging/src/v2'
 @ ./node_modules/@google-cloud/logging/src/v2/config_service_v2_client.js 17:20-64
 @ ./node_modules/@google-cloud/logging/src/v2/index.js
 @ ./node_modules/@google-cloud/logging/src/index.js
 @ ./node_modules/@google-cloud/logging-bunyan/src/index.js
 @ ./server.ts

problem seems to be related with webpack, I bed that if I will try to create nodejs app everything will work out of the box

if you will have problems with reproducing thing thing - please let me know I will create demo repo for this

@stephenplusplus
Copy link
Contributor

We have a similar issue opened in our common issue tracker for all of the @google-cloud/* APIs: googleapis/google-cloud-node#531

Currently, we don't have explicit support for using our libraries outside of a strictly Node environment.

@stephenplusplus stephenplusplus added priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue. labels Jan 31, 2018
@mac2000
Copy link
Author

mac2000 commented Feb 1, 2018

@stephenplusplus seems that you got it wrong, we are speaking about nodejs express app running inside docker container in google cloud kubernetes

@stephenplusplus
Copy link
Contributor

Sorry, I definitely don't want to prematurely close, so let me re-open to make sure I understand. This line is throwing me:

problem seems to be related with webpack, I bed that if I will try to create nodejs app everything will work out of the box

Could you make that demo repo you mentioned?

@mac2000
Copy link
Author

mac2000 commented Feb 2, 2018

Its ok do not worry about it, here is repository with demo: https://github.com/mac2000/logging58

First ensure app is working at all by:

git clone https://github.com/mac2000/logging58
cd logging58
npm i
npm start

then you should be able to see default angular app running on localhost:4000

now in server.ts try to uncomment lines 14-40

and run npm run webpack:server to reproduce issue, you gonna see bazillion of warnings and errors like mentioned above

Hope that helps

@stephenplusplus
Copy link
Contributor

Thank you for putting that together. Unfortunately, since the problem is with mixing our Cloud client libraries with Webpack, that qualifies as an "out of our current bounds" implementation. Webpack is designed to take Node modules and conform them to the browser's environment.

This issue is still the correct place to track support for this. There has also been some discussion on this issue: googleapis/google-cloud-node#1821.

Sorry that we can't be much more help for now.

@ghost ghost removed the priority: p2 Moderately-important priority. Fix may not be included in next release. label Feb 2, 2018
@smonusbonus
Copy link

smonusbonus commented Mar 27, 2018

Same issue here using webpack.

ERROR in ./node_modules/@google-cloud/logging/src/v2/config_service_v2_client.js
    Module not found: Error: Can't resolve './config_service_v2_client_config' in [...]

I don't think it's fair to disregard this saying webpack is only for browser-focused apps. I'm using typescript to build a node backend and there is no way to run this natively.

@google-cloud-label-sync google-cloud-label-sync bot added the api: logging Issues related to the googleapis/nodejs-logging API. label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/nodejs-logging API. type: question Request for information or clarification. Not an issue. web
Projects
None yet
Development

No branches or pull requests

4 participants