#Module not found Server action

2 messages · Page 1 of 1 (latest)

open cradle
#

Hi, I'm getting an error when I import a function from a server component I define with the 'use server', I'm not sure why.
The component i'm importing the server function in is a component, itself imported in a page component.
Error: ```

  • error ./node_modules/next/dist/build/webpack/loaders/next-flight-loader/action-client-wrapper.js:21:37
    Module not found: Can't resolve 'react-server-dom-webpack/client.edge'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./pages/components/server-util.tsx
./pages/components/form-device.tsx
./pages/devices.tsx


```ts
import { addDevice } from "./server-util";
//.....
export default function DeviceForm({ users }: { users: User[] }) {
    const [deviceType, setDeviceType] = useState("");
    const [selectedUser, setSelectedUser] = useState("");
    return (
        <div>
           //....
                 <Button
                 className="ml-10"
                 style={{
                   backgroundColor: "RGB(73, 197, 105)"
                 }}
                 onClick={() => {
                    addDevice({email: selectedUser, device_type: deviceType});
                 }}
               >Send to server</Button>
           
        </div>

    );
};
opal boneBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

      🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in <id:customize>

      ✅ You can mark a message as the answer for your post with `Right click -> Apps -> Mark Solution`
      (if you don't see the option, try refreshing Discord with Ctrl + R)