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

not working correctly with Next.js 13.4.19 #834

Open
R3ps4k opened this issue Sep 17, 2023 · 7 comments
Open

not working correctly with Next.js 13.4.19 #834

R3ps4k opened this issue Sep 17, 2023 · 7 comments

Comments

@R3ps4k
Copy link

R3ps4k commented Sep 17, 2023

After upgrading project to newest release of nextjs everything stopped working. Not a single element with aos property got rendered (animation was not triggered).

Downgrading it back to 13.4.6 solved the issue

This is:

  • Bug

Specifications

  • AOS version: 2.3.4
  • OS: Windows/linux
  • Browser: chrome, edge, firefox

Expected Behavior

Animations should be triggered

Actual Behavior

not a single animation was triggered resulting in unusable website

Steps to Reproduce the Problem

  1. setup nextjs project and add aos
  2. Initialize aos with AOS.init
  3. add any animation to site element
  4. result - element is not visible on the site

Detailed Description

Possible Solution

@DanielOberlechner
Copy link

NextJS version 13.5 was released short time ago. Does this behaviour still exist on the newest NextJS Version?
In my opinion it could be a NextJS bug maybe?

@jsvelte
Copy link

jsvelte commented Oct 14, 2023

I faced the same issue in next.js version 13+ and I did correctly the installation and It didn't work properly on my end!

@DanielOberlechner
Copy link

DanielOberlechner commented Oct 14, 2023

I personally shifted from AOS to animejs which is a far better library to also a bit more complex ... maybe that would be a solution for both of you? :)

Keep in mind last commit was October 2018 ...

@jsvelte
Copy link

jsvelte commented Oct 15, 2023

I fixed my issue please refer here shadcn-ui/ui#1745

@bdhamithkumara
Copy link

same issue in next.js 14.0.4

@ABCodez
Copy link

ABCodez commented Mar 19, 2024

A solution that worked for me was adding a slight delay in initializing AOS (Next.js 14.1.0):
image

@Harukisatoh
Copy link

In my case the problem was that all the images were by default lazy loaded. To solve the issue I had to create an Image component that refreshed the AOS as soon as the image finished loading, and then I used this component across the app instead of the next/image one.

This is the piece of code that I used:

"use client";

import AOS from "aos";
import ImageComponent, { ImageProps } from "next/image";

export function Image(props: ImageProps) {
  return (
    <ImageComponent
      {...props}
      onLoad={() => AOS.refresh()}
    />
  )
}

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

6 participants