Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in NextJS Production, no error in dev #54

Open
lpbonomi opened this issue Apr 23, 2024 · 0 comments
Open

Error in NextJS Production, no error in dev #54

lpbonomi opened this issue Apr 23, 2024 · 0 comments

Comments

@lpbonomi
Copy link

This is the error I get:

11:53:52:111 Agora-SDK [INFO]: browser compatibility {"getDisplayMedia":true,"getStreamFromExtension":true,"supportUnifiedPlan":true,"supportMinBitrate":true,"supportSetRtpSenderParameters":true,"supportDualStream":true,"webAudioMediaStreamDest":true,"supportReplaceTrack":true,"supportWebGL":true,"webAudioWithAEC":false,"supportRequestFrame":true,"supportShareAudio":true,"supportDualStreamEncoding":false,"supportDataChannel":true,"supportPCSetConfiguration":true,"supportWebRTCEncodedTransform":true,"supportWebRTCInsertableStream":true} {"name":"Chrome","version":"123","os":"Mac OS","osVersion":"10.15.7"}
app-index.tsx:25 TypeError: r is not a function
    at t.exports (index.js:8:58768)
    at index.js:8:58832
    at $a (index.js:8:5850)
    at index.js:8:58520
    at index.js:8:81
    at 8734 (index.js:8:215)
    at d (bootstrap:21:1)
    at 3931 (index.modern.js:445:16)
    at Function.d (bootstrap:21:1)
window.console.error @ app-index.tsx:25

And this is my code

'use client';

import dynamic from 'next/dynamic';
import { useState } from "react";
let AgoraUIKit = dynamic(() => import('agora-react-uikit'), { ssr: false });

type Role = "audience" | "host" | null

export default function Home() {
  const [role, setRole] = useState<Role>();

  return (
    <main className="flex min-h-screen flex-col items-center justify-between p-24">
      {AgoraUIKit && role ?
         <AgoraUIKit rtcProps={{
          appId: "",
          channel: "test",
          token: null,
          role: role,
      }}
      styleProps={{
        UIKitContainer:{
          width: '100%',
          height: '100%',
          display: 'flex',
          flexDirection: 'column',
          justifyContent: 'center',
          backgroundColor: '#f0f0f0',
        }
      }}
         /> : (
          <div>
            <button onClick={() => setRole("host")}>Join as Host</button>
            <br></br>
            <button onClick={() => setRole("audience")}>Join as Audience</button>
          </div>
         )
      }
    </main>
  );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant