lottie-player icon indicating copy to clipboard operation
lottie-player copied to clipboard

README for Nuxt 3 seems to be incorrect for Nuxt v3.12

Open blumewas opened this issue 6 months ago • 0 comments

Hello,

I have tried to add Lottie to our nuxt 3 app today. First I have copied the instructions from the README. But when I run npm run dev I have received the following error.

[nuxt] error caught during app initialization TypeError: plugin.apply is not a function

To fix the issue I modified the code in the following way:

import * as LottiePlayer from "@lottiefiles/lottie-player";

// export default LottiePlayer <-- this doesnt seem to work
export default defineNuxtPlugin(() => LottiePlayer); // <-- this works

Now everything works as expected for me. Wanted to share this since maybe some other folks may stumble upon this issue.

blumewas avatar Aug 26 '24 15:08 blumewas