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

[BUG] nextjs 2.75.0 + nextjs 一起使用的时候 lottie-web 导致 document is not defined #2728

Open
1 task done
geekerio opened this issue Feb 25, 2025 · 1 comment
Open
1 task done

Comments

@geekerio
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Which Component

lottie-web

Semi Version

2.75.0

Current Behavior

ReferenceError: document is not defined
at (ssr)/./node_modules/.pnpm/[email protected]/node_modules/lottie-web/build/player/lottie.js (.next/server/vendor-chunks/[email protected]:19:1)
at webpack_require (.next/server/webpack-runtime.js:33:43)
at (ssr)/./node_modules/.pnpm/@DouyinFE[email protected][email protected]/node_modules/@douyinfe/semi-foundation/lib/es/lottie/foundation.js (.next/server/vendor-chunks/@DouyinFE+semi-foundation@[email protected]:1130:1)
at webpack_require (.next/server/webpack-runtime.js:33:43)
at (ssr)/./node_modules/.pnpm/@DouyinFE[email protected][email protected][email protected][email protected][email protected]/node_modules/@douyinfe/semi-ui/lib/es/lottie/index.js (.next/server/vendor-chunks/@DouyinFE[email protected][email protected][email protected]_react@[email protected]:1420:1)
at webpack_require (.next/server/webpack-runtime.js:33:43)
at (ssr)/./node_modules/.pnpm/@DouyinFE[email protected][email protected][email protected][email protected][email protected]/node_modules/@douyinfe/semi-ui/lib/es/index.js (.next/server/vendor-chunks/@DouyinFE[email protected][email protected][email protected]_react@[email protected]:1260:1)
at webpack_require (.next/server/webpack-runtime.js:33:43)

Expected Behavior

No response

Steps To Reproduce

No response

ReproducibleCode

Environment

- OS:
- browser:

Anything else?

No response

@anjiazhuyouxing
Copy link
Contributor

该问题是由于在ssr过程中使用了lottie-web,该包的自执行函数使用了document变量。
目前这个问题已经在跟进中,预计下周可以提交PR,review后就会合入分支。

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