Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST requests on dev server gives 404 #136

Closed
hejmartin opened this issue Feb 5, 2024 · 1 comment
Closed

POST requests on dev server gives 404 #136

hejmartin opened this issue Feb 5, 2024 · 1 comment

Comments

@hejmartin
Copy link

Describe the bug
POST requests against the Netlify dev server responds with a 404 error with Function not found...

To Reproduce
Steps to reproduce the behavior:

  1. Run npx create-remix@latest --template netlify/remix-template
  2. Select Netlify Functions when prompted by installer
  3. Create a new route ./app/routes/edit.tsx with a <Form method="POST"> and an action function (see example below)
  4. Start server using netlify dev
  5. Open localhost:8888/edit in browser
  6. Post form
// app/routes/edit.tsx
import { ActionFunctionArgs } from "@remix-run/node";
import { Form } from "@remix-run/react";

export default function Edit() {
    return (
        <Form method="POST">
            <label>
                Title
                <input />
            </label>
            <button type="submit">Save</button>
        </Form>
    )
}

export async function action({ request }: ActionFunctionArgs) {
    return {
        message: "This is a message from the server",
    }
}

Expected behavior
The page on port 8888 should not crash, it should behave the same as when opening localhost:3000, i.e. the Remix dev server, where the POST request works fine. Also, PUT requests seem to work fine on both ports.

I expect to be able to run the netlify dev server locally, as I need to run certain rewrites and redirects specified in netlify.toml.

Screenshots
On port 3000, the POST works:
image

On port 8888, the POST does not work:
image

Desktop:

  • OS: Mac OS 14.1.2
  • Browser: Firefox
  • Netlify CLI: netlify-cli/17.15.7 darwin-arm64 node-v20.11.0
@ascorbic
Copy link
Contributor

Fixed in latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants