antfu-collective/vite-ssg

lottie-web build ssg 报错Ω

OnePieceLiu opened this issue · 1 comments

Describe the bug

[vite-ssg] An internal error occurred.
[vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^

TypeError: Cannot set properties of null (setting 'fillStyle')
at /Users/liuzhang/Desktop/pro/exchange-web/node_modules/lottie-web/build/player/lottie.js:1320:21
at /Users/liuzhang/Desktop/pro/exchange-web/node_modules/lottie-web/build/player/lottie.js:1323:6
at /Users/liuzhang/Desktop/pro/exchange-web/node_modules/lottie-web/build/player/lottie.js:1540:4
at /Users/liuzhang/Desktop/pro/exchange-web/node_modules/lottie-web/build/player/lottie.js:2:83
at Object. (/Users/liuzhang/Desktop/pro/exchange-web/node_modules/lottie-web/build/player/lottie.js:5:3)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at ModuleWrap. (node:internal/modules/esm/translators:169:29)

Node.js v18.18.1

Reproduction

bug

System Info

mac

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
antfu commented

This is a bug/design choice that the package you are using is not compatible with running on Node (SSG/SSR). Please report to that package, or make your usage as client only.