googleapis / nodejs-logging-winston

Node.js client integration between Stackdriver Logging and Winston.
https://cloud.google.com/logging/
Apache License 2.0
105 stars 50 forks source link

issue when importing in node v20 #814

Closed dsportes closed 7 months ago

dsportes commented 11 months ago

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

1) Is this a client library issue or a product issue? This is the client library for . We will only be able to assist with issues that pertain to the behaviors of this library. If the issue you're experiencing is due to the behavior of the product itself, please visit the [ Support page]() to reach the most relevant engineers.

2) Did someone already solve this?

3) Do you have a support contract? Please create an issue in the support console to ensure a timely response.

If the support paths suggested above still do not result in a resolution, please provide the following details.

Environment details

Steps to reproduce

  1. module with the line: import { LoggingWinston } from '@google-cloud/logging-winston'
  2. start the module ->
  3. /home/daniel/git/asocial-srv/node_modules/@google-cloud/logging-winston/build/src/index.js:16 exports.LOGGING_SAMPLED_KEY = exports.LOGGING_SPAN_KEY = exports.LOGGING_TRACE_KEY = exports.LoggingWinston = exports.getCurrentTraceFromAgent = exports.getDefaultMetadataForTracing = exports.express = void 0; ^

TypeError: Cannot set property getCurrentTraceFromAgent of # which has only a getter at Object. (/home/daniel/git/asocial-srv/node_modules/@google-cloud/logging-winston/build/src/index.js:16:144) at Module._compile (node:internal/modules/cjs/loader:1241:14) at Module._extensions..js (node:internal/modules/cjs/loader:1295:10) at Module.load (node:internal/modules/cjs/loader:1091:32) at Module._load (node:internal/modules/cjs/loader:938:12) at Module.require (node:internal/modules/cjs/loader:1115:19) at require (node:internal/modules/helpers:130:18) at Object. (/home/daniel/git/asocial-srv/node_modules/@google-cloud/logging-winston/build/src/middleware/express.js:20:17) at Module._compile (node:internal/modules/cjs/loader:1241:14) at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)

Node.js v20.6.0

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

cindy-peng commented 9 months ago

Hi @dsportes, can you please provide the code you're using to try to configure your logger?

cindy-peng commented 7 months ago

Will close this issue for now as more details are needed from the customer for a repro. Please free free to reopen this issue if this is still happening for you. Thank you!