next.js build error
Answered
Shing posted this in #help-forum
![Avatar](https://cdn.discordapp.com/avatars/525315362779299851/75b71b9ad5b721e27d522e38c95e7481.webp?size=256)
ShingOP
I created a component to put random audio and I want each time the page is reloaded, there is a different audio. The fact is that seeing it from the development environment (
npm run dev
) it works fine, but when I build it (npm run build && npm run start
), it is no longer dynamic, that is, the audio no longer changes every time you reload the website.![Image](https://cdn.discordapp.com/attachments/1191378491028025344/1191378491128684645/image.webp?ex=65a538af&is=6592c3af&hm=b785179c9b70f731a356288a678a23e26f0dc44a7855be576a0e1ff0f18eea50&)
5 Replies
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
sound like the page is static generated
you could try to set the page to dynamic
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
export const dynamic = 'force-dynamic'
Answer
![Avatar](https://cdn.discordapp.com/avatars/525315362779299851/75b71b9ad5b721e27d522e38c95e7481.webp?size=256)
ShingOP
That's it, thank you very much.