Next.js Discord

Discord Forum

Receiving Module not found: Can't resolve 'fs' Error while calling Server actions in Client Compont

Unanswered
Bridled Titmouse posted this in #help-forum
Open in Discord
Bridled TitmouseOP
I am not able to use it or import server action in the client component.

21 Replies

Hi,

Can you share some code so we can help?
Bridled TitmouseOP
Here is the code
What is the code inside getRunNames file ?
Bridled TitmouseOP
This is the code inside getRunNames
This is the actual client component code
Bridled TitmouseOP
It's still not working
Netherland Dwarf
I had this error before
Bridled TitmouseOP
How did you resolve...?
Netherland Dwarf
For my case i switched to an alternative which node has be dedault
Let me doible check it.
Bridled TitmouseOP
@Julienng can you please help me in this
Netherland Dwarf
Okay my solution was a different issue, but i was going to say
This error happens when trying to call a server package on client side, so hmm i wanted to test to see if it works but using next.js route
Or next api
Maybe you can try that and let us know how it goes
Bridled TitmouseOP
Can't we use server actions in this case
Keeping apart routes in next api..?
Hi, I've created a small example using a server action:

https://codesandbox.io/p/devbox/sad-tree-5wqkvd
It's difficult to help with just some screenshots. If you can create a small example of your problem with codesandbox, that would help me a lot