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 pages dev` 404s some functions/routes

See original GitHub issue

functions/index.ts and functions/*/index.ts , functions/_middleware.ts and functions/*/_middleware.ts work, but nothing else. For example, functions/*/*/index.ts does not work. Parameterized paths also don’t work.

I’m on Windows. To repro, open new folder, npm init, npm i wrangler@alpha, create functions folder, create index.ts, insert:

export const onRequestGet: PagesFunction<{}> = async ({ request, env }): Promise<Response> => {
    return new Response("hello1", { status: 200 })
}

Run npx wrangler pages dev ./. Move it to functions/index.ts, http://localhost:8788/ works fine. Move it to functions/test/test/index.ts, http://localhost:8788/test/test/ returns a 404.

The other day, this was happening both when building on Cf and when I tried using wrangler pages dev. Now it’s just happening with wrangler. This seems like an isolated case, so let me know if there’s any more info I can provide.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
elemental-mindcommented, Dec 18, 2021

Should have put my comment here. It’s a bug in the code generator:

https://github.com/cloudflare/wrangler2/issues/50#issuecomment-997289714

0reactions
Mexican-Mancommented, Feb 15, 2022

It seems as though that PR (or another one from 0.0.16) introduced a bug where the “route deduplication” is disregarding methods. This doesn’t seem like it would be a Windows exclusive issue, but I’ve gone ahead and made another PR #465.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloudflare Pages Wrangler local proxy returns 404 for SPA
I have a Pages Single-Page App (SPA) with a hello world function. I've got it working on Cloudflare servers. the '/' route works...
Read more >
Wrangler commands - Cloudflare Workers docs
Wrangler commands. Wrangler offers a number of commands to manage your Cloudflare Workers. docs - Open this page in your default browser.
Read more >
Untitled
Youtube jimmy page mandolin, Red velvet irene pre debut, Music 60th! ... Saginaw michigan weather news, Winterquell bergbau route, Time zero watch online, ......
Read more >
Untitled
Indian teepee drawing, Apple developer guidelines icons, Pitt panthers first round draft picks, Anime face features, Bouvier breeders washington state, ...
Read more >
Leave GoDaddy and Go Completely Serverless Using Just ...
Set up a Cloudflare Worker Dev Environment; Step 16. ... Some people throw a lot of services at serverless, ... Serve a custom...
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