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

Could not resolve "../package.json" on v5.20.1 #1934

@dryror

Description

@dryror

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?
    library issue

  2. Did someone already solve this?
    Not that I can find

  3. Do you have a support contract?
    No

Environment details

  • OS: macOS
  • Node.js version: 14 and 16
  • npm version: 6.14.16 and 8.5.5
  • @google-cloud/storage version: v5.20.1

Steps to reproduce

  1. Install @google-cloud/storage and use it as a dependency in your project
  2. Package your project with esbuild
  3. See that it fails with the following errors:
✘ [ERROR] Could not resolve "../package.json"

    node_modules/@google-cloud/storage/build/src/storage.js:384:34:
      384 │             packageJson = require('../package.json');
          ╵                                   ~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "../../package.json"

    node_modules/@google-cloud/storage/build/src/nodejs-common/util.js:37:26:
      37 │     packageJson = require('../../package.json');
         ╵                           ~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "../package.json"

    node_modules/@google-cloud/storage/build/src/gcs-resumable-upload.js:37:26:
      37 │     packageJson = require('../package.json');
         ╵                           ~~~~~~~~~~~~~~~~~

I am using firebase-admin which has @google-cloud/storage as a dependency. When I pin @google-cloud/storage to 5.19.4 I can package my app fine with esbuild. When it is updated to v5.20.1 it starts to fail with the above error.

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/nodejs-storage API.priority: p2Moderately-important priority. Fix may not be included in 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