Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
This repository was archived by the owner on Feb 7, 2026. It is now read-only.

Cannot read property 'APP_ENGINE' of undefined #277

@sushshring

Description

@sushshring

Creating the express middleware for logging causes the application to crash, as the variable that APP_ENGINE is being read from is undefined.

Environment details

  • OS: AppEngine Standard Env
  • Node.js version: 8.x.x
  • npm version: 6.4.1
  • @google-cloud/logging-bunyan version: 0.10.0

Steps to reproduce

  1. Create the express.middleware() from the logging library
  2. See crash due to value APP_ENGINE being read from some undefined object.

Stacktrace

TypeError: Cannot read property 'APP_ENGINE' of undefined
    at Object.<anonymous> (..../node_modules/@google-cloud/logging-bunyan/build/src/middleware/express.js:55:50)
    at Generator.next (<anonymous>)
    at fulfilled (..../node_modules/@google-cloud/logging-bunyan/build/src/middleware/express.js:4:58)
    at propagateAslWrapper (..../node_modules/async-listener/index.js:504:23)
    at ..../node_modules/async-listener/glue.js:188:31
    at ..../node_modules/async-listener/index.js:541:70
    at ..../node_modules/async-listener/glue.js:188:31
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)
    at process.fallback (..../node_modules/async-listener/index.js:565:15)

I tested that this error vanishes on 0.9.5. I'm not sure if there is some breaking change introduced in the new release which needs me to change how I'm setting up the middleware.

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

Thanks!

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: loggingIssues related to the googleapis/nodejs-logging-bunyan API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions