Error deploying serverless API

I am trying to deploy my serverless API in order to create a react app. I followed all of the steps here: and was able to successfully build. But immediately after the “Build Successful” message, I get this error. Any ideas on why this is?

Error: :warning: There was an error fetching your subdomain.
Status Code: 404 Not Found
Msg: {
“result”: null,
“success”: false,
“errors”: [
“code”: 10007,
“message”: “workers.api.error.script_not_found”

What does your wrangle.toml file look like?

name = “serverless-api”
type = “javascript”
zone_id = “”
account_id = “”
route = “”
workers_dev = true
compatibility_date = “2021-11-23”

kv_namespaces = [
{ binding = “MY_KV”, id = “c2d64ac1b94d447daf93f0013d3a853b” }

command = “npm install && npm run build”
format = “service-worker”

Not sure if they have been redacted for the post but you need account_id and zone_id filled out.

If they are there, have you gone to the workers section in Cloudflare and created your subdomain?

I have added the account_id and zone_id, as well as creating my subdomain and it successfully published. However, when I run the test command, curl, it provides me with a large html dump with an exception as follows,

Worker threw exception | | Cloudflare

Do you know why this is?

That means the worker code threw an uncaught exception. You can run wrangler dev and it will run your code locally for better debugging.