Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: FileList is not defined #2

Open
ronaldprofile opened this issue Apr 28, 2023 · 1 comment
Open

ReferenceError: FileList is not defined #2

ronaldprofile opened this issue Apr 28, 2023 · 1 comment

Comments

@ronaldprofile
Copy link

Galera criei meu projeto usando Next, e quando cheguei nessa parte do input file acabou nesse erro.

@GabrielTimba
Copy link

Olá @ronaldprofile isso está acontencendo porque o schema está a ser executado no lado do servidor também e o node não está reconhecendo o tipo FileList que é um tipo que o browser reconhece,assim sendo voce pode setar o tipo da seguinte maneira:

avatar: typeof window === 'undefined' ? z.undefined() : z.instanceof(FileList)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants