Repository: next.js
Issue: Unhandled rejection when trying to bind a server action with an unserializable value in dev mode
Labels: bug

### Link to the code that reproduces this issue

https://github.com/tom-sherman/next-action-return-value-error/blob/6ce8a79446b681aeaac07aa2903aeab8c46e7bc3/app/bound-value-error/page.tsx

### To Reproduce

1. Render `<form action={action.bind(null, new Foo())}>` - here `Foo` is just an example of a non serializable value
2. `next dev`

### Current vs. Expected behavior

Currently this logs an unhandled rejection on the server render when running in dev mode:

```
unhandledRejection: Error: Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported.
    at /Users/tom.sherman/code/next-action-return-value-error/node_modules/.pnpm/next@14.1.1-canary.12_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:278749
    at Array.toJSON (/Users/tom.sherman/code/next-action-return-value-error/node_modules/.pnpm/next@14.1.1-canary.12_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:281600)
    at stringify (<anonymous>)
    at /Users/tom.sherman/code/next-action-return-value-error/node_modules/.pnpm/next@14.1.1-canary.12_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:267956
    at ez (/Users/tom.sherman/code/next-action-return-value-error/node_modules/.pnpm/next@14.1.1-canary.12_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:268035)
    at eH (/Users/tom.sherman/code/next-action-return-value-error/node_modules/.pnpm/next@14.1.1-canary.12_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:268436)
    at Timeout._onTimeout (/Users/tom.sherman/code/next-action-return-value-error/node_modules/.pnpm/next@14.1.1-canary.12_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:264934)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)
```

It does throw the error on the client when it's submitted but I would expect to get an early error here (on render) instead of it being an unhandled rejection.

### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000
Binaries:
  Node: 20.9.0
  npm: 8.13.2
  Yarn: 1.22.19
  pnpm: 8.14.0
Relevant Packages:
  next: 14.1.1-canary.12 // There is a newer canary version (14.1.1-canary.13) available, please upgrade! 
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

App Router

### Which stage(s) are affected? (Select all that apply)

next dev (local)

### Additional context

The error is correctly reported when Next.js tries to prerender the route on `next build`