In Nextjs app router it happen when you import a function from which uses server rendering. So just add 'use server' directive in the function file and it will work fine