You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like for some reason the fake type is being generated as an array of array of enums instead of just the array of enums that it should be.
What were you expecting to happen?
…
Any logs, error output, etc?
Here's the typescript error that's also visible in the IDE
❯ npm run build
>[email protected] build
> tsc -b && vite build
src/handlers/example.ts:36:3 - error TS2322: Type '(2 | 1 | 3)[][] | undefined' is not assignable to type'ExampleEnum[] | null | undefined'.
Type '(2 | 1 | 3)[][]' is not assignable to type'ExampleEnum[]'.
Type '(2 | 1 | 3)[]' is not assignable to type'ExampleEnum'.
36 exampleProperty: faker.helpers.arrayElement([
~~~~~~~~~~~~~~~
src/handlers/example.ts:22:3
22 exampleProperty?: ExampleEnum[] | null;~~~~~~~~~~~~~~~
The expected type comes from property 'exampleProperty' which is declared here on type'ExampleResponse'
Found 1 error.
What are the steps to reproduce this issue?
I was able to get a minimal repro stood up:
https://stackblitz.com/edit/vitejs-vite-xqak8w?file=src%2Fhandlers%2Fexample.ts&view=editor
What happens?
It looks like for some reason the fake type is being generated as an array of array of enums instead of just the array of enums that it should be.
What were you expecting to happen?
…
Any logs, error output, etc?
Here's the typescript error that's also visible in the IDE
Any other comments?
…
What versions are you using?
The text was updated successfully, but these errors were encountered: