ampproject / ampproject/cloudflare-amp-optimizer

KV and workers.dev Route Errors

Open
#28 20 comments 0 reactions 1 assignee Claimed by @samouri View on GitHub
bug
Dominant language
JavaScript
Stars
23
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have set up and published my worker to Cloudflare but there seems to be one issue I am having and that is with the KV Namespace. Below is the exact code I put in my wrangler.toml file and the KV cache is enabled via the config.json file:

```
[env.prod]
name = "the name PowerShell gave when creating the KV namespace"
route = "https://www.examplesite.com/*"
vars = { MODE = "prod" }
kv_namespaces = [
{ binding = "KV", id = "my-id" }
]
```

I created it using the `wrangler kv:namespace create "KV"` command.

I did not place a preview_id because I wasn't sure how to get one so I left it out. I only have the env.prod code for KV in the wrangler.toml file.

When viewing the worker via the console I get this error:

![Uncaught Error](https://user-images.githubusercontent.com/85046281/121823554-28024c80-cc63-11eb-8617-a8f3cfc0ee24.jpg)

I am not exactly sure as to why the KV would not be defined?

Also, the workers.dev route is active but leads to an Error 523 page. Seems there is a hosting error. I am thinking I turn that off and go straight through the additional route I added instead?

Thank you in advance for any help I receive!

Thanks and regards,

Tug

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.