question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSR Date Picker drop document is not defined error

See original GitHub issue

TuSimple/naive-ui version (版本)

2.24.7

Vue version (Vue 版本)

3.2.25

Browser and its version (浏览器及其版本)

Chrome 97.0.4692.99

System and its version (系统及其版本)

MacOs 12.1

Node version (Node 版本)

Reappearance link (重现链接)

https://gitlab.com/pitama99/naiveui-ssr/-/tree/master

Reappearance steps (重现步骤)

After when is install the component library to my ssr demo it’s works. But when I add the datepicker to my Home page, after restart it’s drop an error:

ReferenceError: document is not defined
    at Object.queryElement (/Users/pintertamas/Frontside/ssr-vue/node_modules/css-render/lib/utils.js:17:5)
    at Object.mount (/Users/pintertamas/Frontside/ssr-vue/node_modules/css-render/lib/mount.js:62:35)
    at Object.wrappedMount [as mount] (/Users/pintertamas/Frontside/ssr-vue/node_modules/css-render/lib/c.js:14:35)
    at setup (/Users/pintertamas/Frontside/ssr-vue/node_modules/vueuc/lib/binder/src/Follower.js:97:15)
    at callWithErrorHandling (/Users/pintertamas/Frontside/ssr-vue/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:157:22)
    at setupStatefulComponent (/Users/pintertamas/Frontside/ssr-vue/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6966:29)
    at setupComponent (/Users/pintertamas/Frontside/ssr-vue/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6922:11)
    at renderComponentVNode (/Users/pintertamas/Frontside/ssr-vue/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:198:17)
    at renderVNode (/Users/pintertamas/Frontside/ssr-vue/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:310:22)
    at renderVNodeChildren (/Users/pintertamas/Frontside/ssr-vue/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:325:9)

Expected results (期望的结果)

Works with ssr

Actual results (实际的结果)

it’s not working

Remarks (补充说明)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pitamacommented, Feb 1, 2022

@07akioni thanks the help!

0reactions
07akionicommented, Feb 1, 2022

I find there’s a issue for date picker dropdown panel rendering. You can create an new issue for that. We will try to fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSR Date Picker drop document is not defined error #2322
I find there's a issue for date picker dropdown panel rendering. You can create an new issue for that. We will try to...
Read more >
Nuxt.js document is not defined (vuejs-datepicker)
It means that vuejs-datepicker doesn't work on SSR. I faced the same issue and Following this guide I could resolve the problem.
Read more >
Date Picker Not Showing Up when using Chrome
Hi,. I have a date range parameters in my report, and when viewing it using IE and Firefox ReportViewer, the date picker is...
Read more >
QDate - Quasar Framework
The QDate Vue component provides a method to input dates from Gregorian or Persian calendars.
Read more >
Changelog ⚡️ FormKit — Vue Forms, Supercharged
Fixed a bug that caused empty file inputs to be set to undefined instead of an empty array when node.reset() is called (#319)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found