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 2 routes property ([mf:err] TypeError: Invalid URL)

See original GitHub issue

With wrangler 2 the route property is like;

route = { pattern = "https://example.com/*", zone_id = "<ignored>"}

thus this following line fails with like http://[object Object];

[mf:err] TypeError: Invalid URL

https://github.com/cloudflare/miniflare/blob/98b9d697775ac843ce77eef088dfe655188bc77c/packages/core/src/router.ts#L31-L33

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
mrbbotcommented, May 2, 2022

It’s for mounts (https://miniflare.dev/core/mount). If you have multiple workers in the same Miniflare instance, Miniflare uses the routes for selecting the correct worker. You’re right this could be lazy, and not used if workers aren’t mounted.

2reactions
mrbbotcommented, May 2, 2022

Thanks for reporting this. A temporary solution to this might be to create a separate wrangler.toml file for Miniflare, then point Miniflare to that using the --wrangler-config/-c flag.

Of note, Wrangler 2 includes some things like automatic esbuild bundling and pages functions support that I don’t think will ever be added to Miniflare directly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration · Cloudflare Workers docs
Wrangler optionally uses a wrangler.toml configuration file to customize the development and publishing setup for a Worker.
Read more >
Building a Full-Stack Serverless Application with Cloudflare ...
Wrangler is the command-line tool for generating, building, ... which allows you to build URL -based projects on top of Workers.
Read more >
Changelog - Miniflare
Throw TypeError when calling Fetcher#fetch with an illegal this to match the behaviour of the ... 2️⃣ Add support for Wrangler 2's routes...
Read more >
Full text of "Popular Mechanics 1957-10: Vol 108 Iss 4"
50 PAGES All About Homes featuring TWO NEW AM HOUSES Big News for Boaters ... Shevsi Jeep Rambler 1 8 Does Expert @...
Read more >
Untitled
Arcelus house of cards, Lg revere 2 charger, Pistolet automatique ideal value, ... Daenerys brother death episode, Marina bay sands hotel official website, ......
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