cloudflare / cloudflare/workers-sdk
🐛 BUG: Cannot wrangler pages deploy with pnpm from subdirectory
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.5k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 187
Description
### Which Cloudflare product(s) does this pertain to?
Pages, Wrangler core
### What version(s) of the tool(s) are you using?
3.63.1 [wrangler]
### What version of Node are you using?
20.11.1
### What operating system and version are you using?
macos sonoma 14.5
### Describe the Bug
### Observed behavior
I build my pages project into a subdirectory which includes my functions, so I need to run `pnpm wrangler pages deploy` from that directory. But when I do, wrangler seems to look in the wrong spot for the wrangler tmp.
My project root is `/Users/ianvs/code/defined/webclient`, and i run the following command from `/Users/ianvs/code/defined/webclient/.definednet`:
```
> pnpm wrangler pages deploy build/
✨ Compiled Worker successfully
✘ [ERROR] ENOENT: no such file or directory, open '/Users/ianvs/code/defined/.wrangler/tmp/pages-F5FXhL/functionsWorker-0.20030179475032694.js'
```
Note that it is not looking in `code/defined/webclient`, but rather `code/defined`, one directory too high. The listed file _does_ exist in the correct `code/defined/webclient/.wrangler/tmp` directory.
### Expected behavior
Should execute successfully
### Steps to reproduce
1) in a cloudflare pages project containing worker functions, move those functions into a subdirectory, and build your project into that directory as well.
2) from that directory, using pnpm, run `pnpm wrangler pages deploy` against your built project.
### Please provide a link to a minimal reproduction
_No response_
### Please provide any relevant error logs
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.