googleapis / googleapis/google-cloud-node

Module not found: Can't resolve 'request' in '/vercel/path0/node_modules/.pnpm/google-gax@4.2.1_encoding@0.1.13/node_modules/google-gax/build/src

Open
#4,987 15 comments 0 reactions 1 assignee Claimed by @sofisl View on GitHub
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

I'm getting this error during build time using @google-cloud/tasks in a turborepo(monorepo).

It seems to be directly related to pnpm, I'm using @google-cloud/tasks in another Vercel project which uses yarn, and the error is not triggered during build in this case.

Is pnpm supported?

```
next:build: ⚠ Compiled with warnings

next:build:

next:build: ../../node_modules/.pnpm/google-gax@4.2.1_encoding@0.1.13/node_modules/google-gax/build/src/streamingRetryRequest.js

next:build: Module not found: Can't resolve 'request' in '/vercel/path0/node_modules/.pnpm/google-gax@4.2.1_encoding@0.1.13/node_modules/google-gax/build/src'

next:build:

next:build: Import trace for requested module:

next:build: ../../node_modules/.pnpm/google-gax@4.2.1_encoding@0.1.13/node_modules/google-gax/build/src/streamingRetryRequest.js

next:build: ../../node_modules/.pnpm/google-gax@4.2.1_encoding@0.1.13/node_modules/google-gax/build/src/streamingCalls/streaming.js

next:build: ../../node_modules/.pnpm/google-gax@4.2.1_encoding@0.1.13/node_modules/google-gax/build/src/index.js

next:build: ../../node_modules/.pnpm/@google-cloud+tasks@4.0.1_encoding@0.1.13/node_modules/@google-cloud/tasks/build/src/v2beta2/cloud_tasks_client.js

next:build: ../../node_modules/.pnpm/@google-cloud+tasks@4.0.1_encoding@0.1.13/node_modules/@google-cloud/tasks/build/src/v2beta2/index.js

next:build: ../../node_modules/.pnpm/@google-cloud+tasks@4.0.1_encoding@0.1.13/node_modules/@google-cloud/tasks/build/src/index.js

next:build: ./app/api/crons/prepare-monitor/route.ts
```

#### Environment details

System:
OS: macOS 12.7.2
CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
Memory: 1.29 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.18.2 - ~/.asdf/installs/nodejs/lts/bin/node
npm: 9.8.1 - ~/.asdf/plugins/nodejs/shims/npm
pnpm: 8.11.0 - ~/.asdf/installs/nodejs/lts/bin/pnpm
Browsers:
Chrome: 120.0.6099.234
Safari: 17.2.1
npmPackages:
@google-cloud/tasks: ^4.0.1 => 4.0.1

#### Steps to reproduce

Please include any and all code and/or steps related to reproducing the bug.

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

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.