cloudflare / cloudflare/workers-sdk

🐛 BUG: pages_build_output_dir resolving to root

Open
#5,983 3 comments 0 reactions 2 assignees Assigned to @robertsapunarich View on GitHub
package:workers-utils product:pages
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

### What version(s) of the tool(s) are you using?

3.50.0

### What version of Node are you using?

20

### What operating system and version are you using?

Pages CI

### Describe the Bug

### Observed behavior
If you have a config like:
```
pages_build_output_dir = "/dist"
```

It will resolve to the root of Pages CI (and thus throw an error). It will also fail to resolve in wrangler dev and cause the assets to not be served.

Example bad build: 9feb8399-ddc5-473b-bf90-0776a8f7ca62

### Expected behavior
It should resolve as if it was `./` (as in, within the defined root). This is the behaviour today on Pages and we should continue it through wrangler.toml

### Steps to reproduce

Set:
```
pages_build_output_dir = "/dist"
```

and try to run a build through CI or run `wrangler pages dev`

### Please provide a link to a minimal reproduction

_No response_

### Please provide any relevant error logs

_No response_

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.