Using Wrangler for Pages

Might be a dumb question – I started experimenting with Workers and Pages today, so please bare with me…

I am trying to understand how to use wrangler to update Pages. I tried wrangler pages deploy and was able to successfully deploy a webpage. But then I noticed that there was no wrangler.toml file generated in my project directory, and got curious as to how the wrangler CLI knows which project to deploy to deploy my assets to. When trying to figure that out, I tried deleting the project from the web UI, hoping that it will reset the target project. But instead, now I just keep getting this error:

Project not found. The specified project name does not match any of your existing projects. [code: 8000007]

Some questions…

  • Where/how does wrangler get configured for Pages, and how does it know what project to upload the assets to?
  • How can the user update this association?
  • Is there a way to have this be maintained through a local configuration file (I assume that wrangler.toml is doing that for the Worker directory?)

You get prompted to pick a project when you first upload, we then cache that project and keep using it for subsequent uploads. You can also specify --project-name to manually pick one.

You can delete the cache (node_modules/.cache/wrangler/pages.json) to get back to us not knowing a project at all or specify --project-name

Not today but we’re exploring what config looks like right now.

1 Like

Got it. Thank you so much for the quick and clear response!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.