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

UseAsyncValidator doesn't work for SSR #2497

Closed
7 tasks done
theruziev opened this issue Dec 3, 2022 · 4 comments · Fixed by #2761
Closed
7 tasks done

UseAsyncValidator doesn't work for SSR #2497

theruziev opened this issue Dec 3, 2022 · 4 comments · Fixed by #2761

Comments

@theruziev
Copy link
Contributor

Describe the bug

useAsyncValidator doesn't work when SSR is enabled.

I found a discussion and several issues about it:
#2402
yiminghe/async-validator#312

Reproduction

https://stackblitz.com/edit/github-61yzgr?file=app.vue

System Info

System:
    OS: macOS 13.0.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 39.98 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.17.0 - /usr/local/bin/node
    Yarn: 3.2.3 - /usr/local/bin/yarn
    npm: 8.18.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 108.0.5359.94
    Firefox: 107.0
    Safari: 16.1
  npmPackages:
    @vueuse/core: ^9.6.0 => 9.6.0 
    @vueuse/integrations: ^9.6.0 => 9.6.0 
    @vueuse/nuxt: ^9.6.0 => 9.6.0

Used Package Manager

npm

Validations

@kevohagan
Copy link

have the same problem with Astro too!

@theruziev
Copy link
Contributor Author

@kevohagan

I copy the source code of useAsyncValidation and store it in the project. I think you can use this workaround for now

@cliqer
Copy link

cliqer commented Jan 30, 2023

@theruziev can you please share where exactly you put the useAsyncValidate folder within Nuxt 3; composables?
I still try to understand the structure there.

@theruziev
Copy link
Contributor Author

theruziev commented Feb 4, 2023

@theruziev can you please share where exactly you put the useAsyncValidate folder within Nuxt 3; composables? I still try to understand the structure there.

@cliqer Yeah, in composable folder
here example:
https://stackblitz.com/edit/github-61yzgr-wtmb2h?file=composable/validator/index.ts

I override Schema with this construction for working properly when generate/build project
image

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

Successfully merging a pull request may close this issue.

3 participants