egidiusmengelberg / nuxt-aos

A Nuxt module that adds Animate On Scroll
https://www.npmjs.com/package/nuxt-aos
MIT License
65 stars 5 forks source link

Uncaught SyntaxError import debounce from "/_nuxt/node_modules/.pnpm/lodash.debounce@4.0.8/node_modules/lodash.debounce/index.js?v=ec69d98d"; #6

Closed Kaysem closed 8 months ago

Kaysem commented 1 year ago

Uncaught SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/lodash.debounce@4.0.8/node_modules/lodash.debounce/index.js?v=ec69d98d' does not provide an export named 'default' (at aos.esm.js?v=ec69d98d:2:8)

egidiusmengelberg commented 1 year ago

Yeah i'm aware of the issue. Seems to be a problem with cjs and esm imports. I'm very busy at the moment so can't investigate and fix the issue at this time. But feel free to create a PR.

tolgahanbeyazoglu commented 11 months ago

@Kaysem Did you solve the problem?

YourItalianChef commented 11 months ago

@tolgahanbeyazoglu you can just add AOS like plugins download aos.

named file like: aos.cliente.js

inside file import AOS from 'aos' import 'aos/dist/aos.css'

export default defineNuxtPlugin(nuxtApp => { console.log(nuxtApp) if (typeof window !== 'undefined') { nuxtApp.AOS = AOS.init() } })

egidiusmengelberg commented 10 months ago

There is a PR ready to be merged at the AOS library, link. But it seems the project is dead. Last update was 5 years ago. I'll try and email the author next week. If that doesn't work I could create a fork and update it myself. But that would not be a elegant solution. Anybody any ideas?

rubymignot commented 10 months ago

We could maintain it yeah, I'd be down to contribute if you fork and update EDIT: Unrelated but could you update the npm package please? EDIT 2: Oop okay this one's on me for npm, sorry, fixed in #9

khalednadam commented 10 months ago

Hello, is there any work around for this issue

egidiusmengelberg commented 10 months ago

I think writing your own nuxt3 plugin would work. https://stackoverflow.com/questions/71484930/using-aos-with-nuxt3

Islam8Bahaa commented 9 months ago

You can try this nuxt3-aos it working Good

tolgahanbeyazoglu commented 8 months ago

@Islam8Bahaa Yes, it works smoothly thanks to the module you specified.

BayBreezy commented 8 months ago

The issue is actually because the aos package needs to be transpiled. It should also be added to the list of optimizedDeps. I will do a PR soon.

tolgahanbeyazoglu commented 8 months ago

@BayBreezy We are waiting

BayBreezy commented 8 months ago

I did the PR lol. My bad for not mentioning it here. Its PR #12 @tolgahanbeyazoglu

egidiusmengelberg commented 8 months ago

Yeah nice, in v1.2.2 it seems fixed. Just tried it with a fresh nuxt project (v3.9.0) so closing this issue.