Skip to content

Commit e710f25

Browse files
committed
Add issue to well known caveats.
1 parent 8ff2646 commit e710f25

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ Start your API server with I/O schema validation and custom middlewares in minut
5959
5. [Graceful shutdown](#graceful-shutdown)
6060
6. [Subscriptions](#subscriptions)
6161
8. [Caveats](#caveats)
62-
1. [Excessive properties in endpoint output](#excessive-properties-in-endpoint-output)
62+
1. [TypeError: example is not a function](#typeerror-example-is-not-a-function)
63+
2. [Excessive properties in endpoint output](#excessive-properties-in-endpoint-output)
6364
9. [Your input to my output](#your-input-to-my-output)
6465

6566
See also [Changelog](CHANGELOG.md) and [automated migration](https://www.npmjs.com/package/@express-zod-api/migration).
@@ -1394,6 +1395,11 @@ framework, [Zod Sockets](https://github.com/RobinTail/zod-sockets), which has si
13941395
There are some well-known issues and limitations, or third party bugs that cannot be fixed in the usual way, but you
13951396
should be aware of them.
13961397

1398+
## TypeError: example is not a function
1399+
1400+
If you face this error then [switch your environment to ESM](#environment-preparation).
1401+
See [issue 2981](https://github.com/RobinTail/express-zod-api/issues/2981) for details.
1402+
13971403
## Excessive properties in endpoint output
13981404

13991405
The schema validator removes excessive properties by default. However, Typescript
@@ -1402,13 +1408,9 @@ in this case during development. You can achieve this verification by assigning
14021408
reusing it in forced type of the output:
14031409

14041410
```typescript
1405-
import { z } from "zod";
1411+
const output = z.object({ anything: z.number() });
14061412

1407-
const output = z.object({
1408-
anything: z.number(),
1409-
});
1410-
1411-
endpointsFactory.build({
1413+
factory.build({
14121414
output,
14131415
handler: async (): Promise<z.input<typeof output>> => ({
14141416
anything: 123,

0 commit comments

Comments
 (0)