Page transitions in template only work once built
Unanswered
Thrianta posted this in #help-forum
ThriantaOP
This transition only works on hard reload in dev, and gets stuck in the "initial" variant on page changes. But, once built, functions as expected.
6 Replies
@Thrianta This transition only works on hard reload in dev, and gets stuck in the "initial" variant on page changes. But, once built, functions as expected.
not sure what went wrong in your case; for me template.js works well both in dev mode and in prod mode. i use pure css though, not framer motion:
check [this](https://github.com/joulev/website/blob/71fd659c7ed5fb16350568458c26ad37449888f8/src/app/(public)/template.tsx) and [this](https://github.com/joulev/website/blob/71fd659c7ed5fb16350568458c26ad37449888f8/src/app/globals.css#L96-L112).
check [this](https://github.com/joulev/website/blob/71fd659c7ed5fb16350568458c26ad37449888f8/src/app/(public)/template.tsx) and [this](https://github.com/joulev/website/blob/71fd659c7ed5fb16350568458c26ad37449888f8/src/app/globals.css#L96-L112).
ThriantaOP
cool having a look now
ThriantaOP
i noticed you pass your template div a key. i added that and it works in my project. (edit, it didnt) although i thought this was the point of template vs layout already.
actually its still not working with the pathname being used as the key
ThriantaOP
i downgraded from nextjs 15 to 13 and everything worked as expected 🧐