hilongjw / vue-lazyload

A Vue.js plugin for lazyload your Image or Component in your application.
http://hilongjw.github.io/vue-lazyload/
MIT License
7.99k stars 865 forks source link

Solution to Nuxt3 getSSRProps Error #514

Open weilengdezaoshang opened 1 year ago

weilengdezaoshang commented 1 year ago

I saw in the issue of nuxt3 that the nuxt3 team is handling errors reported by plugins in nuxt3. I am not sure if this can be used to solve errors in SSR running nuxt3 team solution

wf-soft commented 1 year ago

The same problem occurs only when he refreshes or goes directly to the page after posting to the server. There is no problem jumping from other pages, and there is no problem with local testing, even if he uses vue-lazyload-ssr, it is the same bug.

Aybee5 commented 9 months ago

I am also experiencing this problem

Milk-Ice commented 8 months ago

I am also experiencing this problem

andreww2012 commented 7 months ago

In Nuxt 3, this error happened to me when I was registering the lazyload plugin only on client. You just need to register it both on client and server (remove .client prefix from a Nuxt plugin file), just like this:

import VueLazyload from 'vue-lazyload';
import {defineNuxtPlugin} from '#imports';

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.use(VueLazyload);
});
yyt-do commented 5 months ago

This is just as problematic after packing

11003 commented 1 week ago

@hilongjw 希望作者尽快修复一下这个问题❤️