Redirects fail in dev after 'ntl link'

This is a follow up to an earlier post - Thanks @coelmay for helping me narrow it down.

Here are the steps for me to reproduce this dev mode issue on my ubuntu 20.02 machine:

  • Clone the repo to a test directory git clone git@github.com:ddrake/netlify-feature-tour.git testdir. This repo contains the getting started tutorial code including a public/_redirects file with contents: /api/* /.netlify/functions/:splat. The redirect works at the live site, that is, https://sunnyside-math.netlify.app/api/hello-world correctly redirects to https://sunnyside-math.netlify.app/.netlify/functions/hello-world.
  • cd test && npm install
  • Start dev server: ntl dev
  • Browse to localhost:8888/api/hello-world → get 200 response with “hello world! I have a undefined”. The redirect works! (undefined appears because the site is not linked so an environment variable is missing.)
  • Link directory to the site via ntl link
  • Browse to localhost:8888/api/hello-world → “404 Not Found Path: /api/hello-world/index.htm”
  • Browse to localhost:8888/.netlify/functions/hello-world → “200 hello world! I have a super secret”
    So the function works, but the redirect is broken in dev.

Thanks for any help on this!