question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"wrangler publish" fails, "Error: missing field `type`"

See original GitHub issue

I’m very new at this and having a bad time

The wrangler.toml does not have a “type” entry so “wrangler publish” fails like this:

$ wrangler r2 bucket list
Error: missing field `type`

I tried putting type = "javascript" in the file but it did not work

$ wrangler publish
✨  Basic JavaScript project found. Skipping unnecessary build!
Error: The entrypoint of your Worker (dist/index.js) could not be found.

I tried type = "typescript" but also did not work

$ wrangler publish
Error: enum TargetType does not have variant constructor typescript

I tried some other random guesses but nothing that worked

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
catharsis71commented, Jun 5, 2022

Thank you for all your assistance on this

yes, a base/prefix thing could potentially be useful but not really a big deal

0reactions
kotxcommented, Jun 5, 2022

If I do it like this do I need to move all my files into a /files/ subdirectory in the bucket or something along those lines?

Yeah, you’d have to prefix all your files with files/. I could add functionality to have a base/prefix path to look for, if you like.

I’ll also close this issue since the original problem was resolved, but if you have any other questions feel free to ask them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No documentation about the type field now required ... - GitHub
I updated wrangler, and got this: > wrangler build Error: ... project config has an error, check your `wrangler.toml`: missing field `type`" ...
Read more >
Deprecations · Cloudflare Workers docs
Here are common fields that are no longer required. type is no longer required. Wrangler will infer the correct project type automatically.
Read more >
wrangler 1.5.0 - Docs.rs
Changelog ## 1.5.0 - ### Features - **Deprecate `wrangler publish --release` ... the `private` field no longer functions in `wrangler.toml`.
Read more >
Cloudflare worker publish failing with 10019 error
We are trying to deploy a Cloudflare worker using wrangler. ... creation failed: Code 10019: workers.api.error.invalid_route_script_missing.
Read more >
Getting started with Fauna and Cloudflare Workers
wrangler publish. This creates and uploads the Worker to Cloudflare. The command response should display your Worker's web address.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found