tusen-ai / naive-ui

A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
https://www.naiveui.com
MIT License
15.53k stars 1.63k forks source link

Compatibility Issue with <n-date-picker> Component in Nuxt 3 SSR Environment #6044

Open wscart opened 2 weeks ago

wscart commented 2 weeks ago

Describe the bug

Problem Description When using the component in a Nuxt 3 project, I encountered an issue where the page works fine on the initial visit but suddenly redirects to the homepage upon refreshing.

Upon investigation, I found that this issue is related to the server-side rendering (SSR) mechanism in Nuxt 3. Specifically, there is an inconsistency between client-side and server-side rendering of the component, leading to the redirection issue upon page refresh.

`

`

Steps to reproduce

.

Link to minimal reproduction

/

System Info

System:
    OS: macOS 14.5
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 35.28 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.5.1 - ~/.nvm/versions/node/v20.5.1/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.2.4 - ~/Library/pnpm/npm
    pnpm: 8.3.1 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 125.0.6422.142
    Safari: 17.5
  npmPackages:
    naive-ui: ^2.38.1 => 2.38.1

Used Package Manager

pnpm

Validations