Next.js Discord

Discord Forum

Module not found: Can't resolve 'react-server-dom-webpack/client'

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
Import trace for requested module:
./lib/actions.ts
./pages/login.tsx

./node_modules/.pnpm/next@14.1.0_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js
Module not found: Can't resolve 'react-server-dom-webpack/client'

when using 'use server';

21 Replies

It's probably a client component that u are trying to mark as server
Barbary LionOP
im marking the next-auth lib/actions.ts as server due to a different issue which according to github the file should be using server
Error: Invariant: headers() expects to have requestAsyncStorage, none available.
this one
Can u show the code
Barbary LionOP
lib/actions.ts
auth.ts
the password is hardcoded for now dont worry
shouldnt the nextauth be defined in the api route [...nextauth]?
Barbary LionOP
hmm kinda different from stable next auth
Barbary LionOP
I followed their own steps and it didnt work smh
Cuvier’s Dwarf Caiman
@Barbary Lion meow
@Cuvier’s Dwarf Caiman <@721111497392128162> meow
Barbary LionOP
:3
I fixed it by not following the official guide™️
@Barbary Lion I fixed it by not following the official guide™️
Giant panda
how did you fix it ?
@Giant panda how did you fix it ?
Barbary LionOP
I had to annotate "use server" in a bunch of places, and migrate to the /api/auth/[...nextAuth].ts Routing
Giant panda
Thanks, cause I'm having a similar issue with using Discord sdk in a server action.
https://nextjs-forum.com/post/1206356513329778758#message-1206356513329778758