# Troubleshoot scroll reveal animations

> Fix common Awesome Reveal problems: content that never shows, shows early, hides again or has no animation, elements that lose their styles, and console errors.

Find the symptom in the list. Each section gives the possible causes, and links to the page with the fix.

## The content never shows

* **An ancestor with `overflow` clips the element fully.** The element never enters the visible area, so it does not reveal. [Play the entrance by hand](/guides/manual-control/#play-clipped-content-by-hand).
* **In `reveal()`, the start state moves the element out of the visible area.** The element waits at its start state. If an ancestor clips that box fully, the element does not reveal. See [The start state moves the box of `reveal()`](/guides/timing/#the-start-state-moves-the-box-of-reveal).
* **In React, Vue and Astro, `when` is `false`.** The element stays transparent until `when` becomes `true`. See [Reveal from your state](/guides/manual-control/#reveal-from-your-state).

If no script attaches the element, the content shows after 5 seconds. See [The 5 second hold](/concepts/server-rendering/#the-5-second-hold).

## The content reveals too late or too early

* **In `reveal()`, the start state moves the element.** A start state with `x`, `y`, `scale` or `rotate` and no `opacity: 0` changes the box that the viewport check uses. Your own keyframes change it when the first keyframe has a transform. See [The start state moves the box of `reveal()`](/guides/timing/#the-start-state-moves-the-box-of-reveal).
* **A cascade has many children.** The last children start late or out of view. [Reveal each item](/guides/lists/#reveal-a-long-list-or-a-tall-grid).
* **The `delay` is long.** Keep it short. See [Delay the entrance](/guides/timing/#delay-the-entrance).

## The content shows, then hides again

The script attached the element after the 5 second hold of the stylesheet. Lazy hydration is the usual cause. See [The 5 second hold](/concepts/server-rendering/#the-5-second-hold).

Hydrate the reveal content eagerly:

* **React or Vue in an Astro island:** use [`client:load`](/frameworks/react-vue-astro/#hydrate-the-island-with-clientload), not `client:visible`.
* **Vue and Nuxt:** do not use [lazy hydration](/frameworks/vue-ssr-nuxt/#hydrate-the-reveals-eagerly) for components with a reveal.

Focus can also cause it. Server markup shows while focus is in it, and the hold continues after a blur. This is on purpose.

## The content shows before the entrance

* **The JavaScript API does not hide content before your script runs.** Server-rendered content shows, then animates. See [The JavaScript API](/concepts/server-rendering/#the-javascript-api).
* **The page does not load the stylesheet.** Some setups need a step. See [Hidden in the server HTML](/concepts/server-rendering/#hidden-in-the-server-html).
* **A Content Security Policy blocks the stylesheet in Astro.** See [Content Security Policy](/frameworks/astro/#content-security-policy).
* **Your styles use `!important`.** An inline `opacity` or an `animation` with `!important` can show the element too early. See [Things to know](/concepts/server-rendering/#things-to-know).

The content also shows immediately when the user asks for reduced motion, prints the page or turns off JavaScript. This is on purpose. See [When the stylesheet does not hide content](/concepts/server-rendering/#when-the-stylesheet-does-not-hide-content).

## The content shows with no animation

* **The user asks for reduced motion.** See [Reduced motion](/concepts/accessibility/#reduced-motion).
* **Focus moved into the element before or during the entrance.** Focus reveals a waiting element immediately, and it finishes a running entrance. See [Focus](/concepts/accessibility/#focus).
* **The browser rejected an option.** An invalid easing or duration shows the element with no animation. See [Errors](/concepts/how-it-works/#errors).
* **A cascade child cannot animate.** In React, Vue and Astro, a child that you add after the reveal shows with no animation. An Astro island or an Astro `Reveal` as a direct child of a cascade does not get the entrance of the cascade. See [Things to know](/guides/lists/#things-to-know). In the JavaScript API, a child that you add after the `cascade()` call shows with no animation. See [Targets](/reference/javascript/#targets).
* **In Astro, the HTML parser moved the element.** See [Where to place a reveal](/frameworks/astro/#where-to-place-a-reveal).
* **The browser is too old.** See [Older browsers](/reference/browser-support/#older-browsers).

## The element loses its own styles

* **The entrance replaces the element’s own values of the animated properties.** An example is a `rotate` or an `opacity` that your CSS sets. [Put the value on an inner element](/guides/entrances/#things-to-know), or [use an additive keyframe](/guides/keyframes/#keep-the-elements-own-values).
* **In React, Vue and Astro, the stylesheet replaces your own `animation` until the reveal.** Put your animation on an inner element. See [Things to know](/concepts/server-rendering/#things-to-know).
* **Two calls reveal the same element.** The later entrance replaces the earlier entrance. See [Do not reveal one element two times](/concepts/how-it-works/#do-not-reveal-one-element-two-times).

## The element jumps at the end of the entrance

The last keyframe is different from the resting style of the element. See [End at the resting style](/guides/keyframes/#end-at-the-resting-style).

## Your code waits for animations that never finish

A waiting entrance of `reveal()` or `cascade()` never finishes. An animation of your own that repeats forever also never finishes. See [Wait for the end of the entrance](/guides/reveal-events/#wait-for-the-end-of-the-entrance).

## The build fails

**`Global CSS cannot be imported from within node_modules`.** The Next.js Pages Router with webpack needs a step. See [Set up the Pages Router with webpack](/frameworks/nextjs/#set-up-the-pages-router-with-webpack).

## Errors in the console

* **An invalid easing, duration or threshold.** The browser rejects the option, and core reports the error of the browser. See [Errors](/concepts/how-it-works/#errors).
* **An invalid CSS selector.** `reveal()` and `cascade()` throw a `SyntaxError`. See [Errors](/concepts/how-it-works/#errors).
* **`The HTML parser moved the element out of <awesome-reveal>`.** In Astro, the reveal is in a place that the HTML parser does not accept. See [Where to place a reveal](/frameworks/astro/#where-to-place-a-reveal).
* **`getReveal() needs the element that Reveal or Cascade rendered`.** In Astro, the element is not the tag that `Reveal` or `Cascade` rendered, or the HTML parser moved the tag. Pass the rendered tag, not an ancestor or a child. See [`getReveal`](/reference/astro/#getreveal).

## Get help

If this page does not solve your problem, search the [issues](https://github.com/awesome-reveal/awesome-reveal/issues) of the packages repo. To ask a question, open a [discussion](https://github.com/awesome-reveal/awesome-reveal/discussions). To report a bug, open an issue with a minimal example.
