Repository: next.js
Issue: Unexpected behavior when using output: 'export', generateStaticParams(), and export const dynamic
Labels: bug,Navigation

### Link to the code that reproduces this issue

https://codesandbox.io/p/sandbox/sweet-morning-nl3spx

### To Reproduce

1. Set `output: 'export'` in `next.config.js`
2. Use generateStaticParams() in a Dynamic Route
3. set `export const dynamicParams = false` and/or `export const dynamic = 'force-static'`
4. Run `next dev` and attempt to visit a page on the dynamic route

### Current vs. Expected behavior

___Expected behavior:___

Ignore the Route Segment Config options and/or generate a warning about them not being compatible.

___Actual behavior:___

Everything works correctly as long as you don't use output: 'export' and dynamic/dynamicParams together.

When they are, the following error is sent:
```Error: Page "/[[...slug]]/page" is missing exported function "generateStaticParams()", which is required with "output: export" config.```
The page is obviously not missing the function as it's right there and works fine under different configurations. This error occurs with all three types of Dynamic Routes when the Route Segment Configs are present with `output: export`. (Note: I have only tested with `dynamic` and `dynamicParams` so far.

If you take either of those conditions out, everything works as expected:

- Without the `output: export` option, it will properly serve 404s when visiting a route that isn't generated.
- Without the route segment config
  - visiting a generated param results in a proper site render
  - visiting a non-generated param results in an error saying the route must be generated due to `output: export`
- With or without the route segment config, next build will export a valid configuration by generating HTML pages for each output of generateStaticParams.

The errors only actually happen in next dev when both of the aforementioned conditions are present.

This scenario probably just warrants updated documentation and maybe extra sanity checks.

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
yarn next info
yarn next info
yarn run v1.22.19
$ /project/home/yukigamine/workspace/node_modules/.bin/next info

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
Binaries:
  Node: 16.17.0
  npm: 8.15.0
  Yarn: 1.22.19
  pnpm: 7.1.0
Relevant Packages:
  next: 13.5.4-canary.8
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: export


Done in 1.62s.
```


### Which area(s) are affected? (Select all that apply)

App Router, Routing (next/router, next/navigation, next/link), Static HTML Export (output: "export")

### Additional context

During testing, I went back to 13.4.19 and did not receive the error about generateStaticParams() missing under the circumstances described in this big report. I have not yet had a chance to look into whether the error just didn't exist yet or simply wasn't being thrown in that version, but it did entirely ignore the Route Segment Config options.

#### EDIT: For those looking for a workaround--
Rather than downgrading, simply remove `export const dynamicParams = false` and/or `export const dynamic = 'force-static'` from your file. These lines don't actually do anything in `output: 'export'` and just cause `next dev` to get confused.