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

The horizontal mode mode="horizontal" of the menu under server rendering appears requestAnimationFrame is not defined #4833

Closed
1 task
a3318375 opened this issue Nov 1, 2021 · 6 comments
Labels

Comments

@a3318375
Copy link

a3318375 commented Nov 1, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.0.0-alpha.6

Environment

win10

Reproduction link

Edit on CodeSandbox

Steps to reproduce

项目主要结构式vue3 vite2 ts antdv3
使用了官方案例的

<a-menu v-model:selectedKeys="current" mode="horizontal">
</a-menu>

项目出现了异常:

[Vue warn]: Unhandled error during execution of setup function
at <PopupTrigger>
ReferenceError: requestAnimationFrame is not defined
at raf (D:\Java\workspace\inyaa-sakura-test\node_modules\ant-design-vue\lib\_util\raf.js:26:7)
at immediate (D:\Java\workspace\inyaa-sakura-test\node_modules\ant-design-vue\lib\menu\src\PopupTrigger.js:74:43)
at callWithErrorHandling (D:\Java\workspace\inyaa-sakura-test\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:6599:22)
at callWithAsyncErrorHandling (D:\Java\workspace\inyaa-sakura-test\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:6608:21)
at doWatch (D:\Java\workspace\inyaa-sakura-test\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:6981:13)
at watch (D:\Java\workspace\inyaa-sakura-test\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:6893:12)
at setup (D:\Java\workspace\inyaa-sakura-test\node_modules\ant-design-vue\lib\menu\src\PopupTrigger.js:69:20)
at callWithErrorHandling (D:\Java\workspace\inyaa-sakura-test\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:6599:22)
at setupStatefulComponent (D:\Java\workspace\inyaa-sakura-test\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:6225:29)
at setupComponent (D:\Java\workspace\inyaa-sakura-test\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:6181:11)

当去掉mode="horizontal"既水平模式,项目式正常的

What is expected?

What is actually happening?

@github-actions github-actions bot changed the title 服务器渲染下的menu的水平模式mode="horizontal"出现 requestAnimationFrame is not defined The horizontal mode mode="horizontal" of the menu under server rendering appears requestAnimationFrame is not defined Nov 1, 2021
@a3318375
Copy link
Author

a3318375 commented Nov 3, 2021

大佬,我想想请问下
刚更新的包3.0.0-alpha.9会出新的错误

ReferenceError: window is not defined
    at returnDocument (D:\Java\workspace\inyaa-sakura\node_modules\ant-design-vue\lib\vc-trigger\Trigger.js:51:3)
    at Proxy.getContainer (D:\Java\workspace\inyaa-sakura\node_modules\ant-design-vue\lib\vc-trigger\Trigger.js:517:28)
    at setup (D:\Java\workspace\inyaa-sakura\node_modules\ant-design-vue\lib\_util\Portal.js:24:27)

我该怎么处理啊(好像是服务端不能操作dom)

@yuji1548
Copy link

一样的问题,vite+ssr遇到,nuxt3 测试也遇到。

@yuji1548
Copy link

安装3.0.0 beta8 测试,可以正常使用,没有bug。

@a3318375
Copy link
Author

安装3.0.0 beta8 测试,可以正常使用,没有bug。

我装了最新版本的16,nuxt3正常启动了,你可以看下我仓库里的inyaa-sakura-nuxt-antdv这个项目

@yuji1548
Copy link

安装3.0.0 beta8 测试,可以正常使用,没有bug。

我装了最新版本的16,nuxt3正常启动了,你可以看下我仓库里的inyaa-sakura-nuxt-antdv这个项目

可以加个好友吗?最近在看vue3和nuxt3这些,网上的资料不是很多,是否可以交流学习一下。

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants