For Workes & Pages, what is the name of the domain?
What is the issue or error you’re encountering
Cannot get Functions working for Cloudflare Pages in local dev
What steps have you taken to resolve the issue?
Has anyone been able to get Cloudflare Pages working locally (wrangler pages dev) whereby both static files and dynamic functions are served and working as expected? I have tried many different methods / setup but cannot get the wrangler dev env to recognise the _routes.json file locally.
Looks like I was running the wrangler pages dev
command in the wrong directory:
opened 04:31PM - 30 Mar 23 UTC
closed 03:50PM - 16 May 24 UTC
enhancement
pages
wrangler
pages-dev
### Describe the solution
In most cases when using functions with a pages pro… ject, the `/functions` directory is being ignored and there are no warnings or information on why that is.
When using `wrangler pages dev` the `/functions` directory is being ignored and Wrangler simply says:
```
No functions. Shimming...
```
It would be nice if Wrangler said something like:
```
We noticed you're using a /functions directory. Sorry this feature is not supported because of X. Check this URL for more information.
```
The docs also don't explain this behavior and mostly point out how to use the `/functions` directory which is extremely confusing.
In some unrelated section of the [pages docs](https://developers.cloudflare.com/pages/platform/direct-upload/#using-functions), it's explained that the `/functions` directory doesn't work with direct uploads either. That's all the information I could gather after two hours of trying to make this work.
The Cloudflare Dashboard doesn't inform users either when uploading a project with a `/functions` directory. Something like this would have been very helpful:
```
We noticed you're using a /functions directory. Sorry this feature is not supported with direct upload. Check this URL for more information.
```
system
Closed
August 28, 2024, 1:09pm
3
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.