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.

Small improvements to wrangler init

See original GitHub issue
  • TypeScript configuration seems to be slightly incorrect:
    • src/index.ts: Cannot find name Promise
    • tsconfig.json: Cannot find global type Array
  • scripts in package.json should be prepopulated with some defaults, e.g.
"scripts": {
  "start": "wrangler dev src/index.ts",
  "deploy": "wrangler publish src/index.ts" 
}
  • wrangler.toml is only populated with compatibility_date, but should also contain:
    • name, matching the name of its directory.
    • workers_dev = true, so it’s easy to publish.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
threepointonecommented, Feb 7, 2022

I’m not aware of whether that fixed the Promise/Array issue. But also, that bug looks highly suspicious, it shouldn’t really occur. Might’ve just needed a vscode restart. If you’re not able to reproduce that issue, consider it fixed.

1reaction
Electroidcommented, Feb 7, 2022

To clarify, we’re deprecating the workers_dev field altogether in wrangler 2, its value can be inferred by the presence/lack of routes. (Unless I’m missing some usecase)

Right… forgot about that. So only the name would be good to add.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrangler commands - Cloudflare Workers docs
Wrangler offers a number of commands to manage your Cloudflare Workers. docs - Open this page in your default browser. init - Create...
Read more >
wrangler/CHANGELOG.md at master · cloudflare ... - GitHub
This PR fixes the issue described in #2068. API errors related to syntax or preview token return the same bad_request status code, and...
Read more >
Getting Started with Rust Cloudflare Workers - Rodney Lab
You can invest small chunks of your time on focussed code, starting with a simple Rust Cloudflare Worker. Then either as the initial...
Read more >
Your static site on Cloudflare Workers Site - Medium
Let's make some changes to the newly created wrangler.toml file: Place account_id and zone_id; Change route to something like *blog.example.com ...
Read more >
What's New in Wrangler? - YouTube
Wrangler is the command-line tool for building Cloudflare Workers. In this video, we take a look at some of the new features that...
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