Repository: next.js
Issue: Error: Optional route parameters are not yet supported
Labels: bug

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: win32
      Arch: x64
      Version: Windows 11 Pro
    Binaries:
      Node: 20.4.0
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.12
      eslint-config-next: 13.4.12
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.6
    Next.js Config:
      output: N/A
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

App Router

### Link to the code that reproduces this issue or a replay of the bug

https://codesandbox.io/p/sandbox/exciting-hertz-mx9zfh

### To Reproduce

Define a optional segment (do not confuse with `Optional Catch-all Segments`):
```
[[lang]]
``` 

Run `next dev` and see the error:
```
node_modules\.pnpm\next@13.4.12_@babel+core@7.22.9_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\shared\lib\router\utils\sorted-routes.js:129
                    throw new Error('Optional route parameters are not yet supported ("' + urlPaths[0] + '").');
                          ^

Error: Optional route parameters are not yet supported ("[[lang]]").
    at UrlNode._insert (node_modules\.pnpm\next@13.4.12_@babel+core@7.22.9_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\shared\lib\router\utils\sorted-routes.js:129:27)
    at UrlNode.insert (node_modules\.pnpm\next@13.4.12_@babel+core@7.22.9_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\shared\lib\router\utils\sorted-routes.js:13:14)
    at node_modules\.pnpm\next@13.4.12_@babel+core@7.22.9_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\shared\lib\router\utils\sorted-routes.js:165:46
    at Array.forEach (<anonymous>)
    at getSortedRoutes (node_modules\.pnpm\next@13.4.12_@babel+core@7.22.9_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\shared\lib\router\utils\sorted-routes.js:165:21)
    at DevRouteMatcherManager.reload (node_modules\.pnpm\next@13.4.12_@babel+core@7.22.9_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\server\future\route-matcher-managers\default-route-matcher-manager.js:116:55)
    at async DevRouteMatcherManager.reload (node_modules\.pnpm\next@13.4.12_@babel+core@7.22.9_react-dom@18.2.0_react@18.2.0\node_modules\next\dist\server\future\route-matcher-managers\dev-route-matcher-manager.js:110:9)

Node.js v20.4.0
 ELIFECYCLE  Command failed with exit code 1.
```

### Describe the Bug

I'm using i18n. The default locale is `en`. 
When user is matched to `en` locale, I want to have this url:
`example.com/about`.

However, right now, I cannot achieve this and I have to use this convention:
`example.com/en/about`.

I only want to have locale in my URL, when it's not default - `en`.

Similar requests:
https://github.com/vercel/next.js/discussions/50272#discussioncomment-6335787
https://github.com/vercel/next.js/issues/41980#issuecomment-1293881941
https://github.com/vercel/next.js/issues/41980#issuecomment-1328324459
https://github.com/vercel/next.js/issues/41980#issuecomment-1336407237

### Expected Behavior

App router should support optional route parameters.

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

_No response_