In my project there is an one dependency better-sqlite3.
This dependency is working fine.But after some time i am getting the fs module not found error again and again.
I tried all the methods like reinstall the dependencies,clear cache but nothing worked.
1
You can access the Node APIs in Next.js only on the server side. To tap into server-side mode, you have to use the “use server” directive at the top.
There is a very good discussion on GitHub about it:
https://github.com/vercel/next.js/discussions/12124
As you can see that I am using the cookies function which can only be accessed on the server side so I have to use the "use server"
at the top
2