@netlify/plugin-nextjs plugin failed wring publish directory

hello guys
i am trying to deploy a nextjs website
but it fails when it reach the step of installing netlify next js pluging
saying that the publish folder is wrong.

the error is (Error: The directory “out” does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory.
Your publish directory is set to “out”, but in most cases it should be “.next”.)

it says that the publish folder should be .next not out
but i already doing that

i tired clearing cashe and deplying but still not working
its like its not reading my deploy settings but rather using some default settings

thank you for your help in advance

Welcome to the forums @moussaab-moulim

There are two options outlined in the Common Configurations → Next.js:

  1. SSR using the Essential Next.js Build Plugin where the publish directory is .next
  2. Static HTML (using next export) where the publish directory is out

Check out the documentation above and if you have any questions or issues, do not hesitate to reply.

hello @coelmay
thank you for the reply
yes i followed the documentation
as you can see in the screenshot that i set my publish directory to .next
but the error says that i set it to out

i found the solution i had a file in my project called netlify.toml with publish directory set to out