Code Monkey home page Code Monkey logo

Comments (8)

osamaKu avatar osamaKu commented on June 12, 2024 3

Thanks to the Twilio team for building and releasing these sample applications!

To Reproduce

  1. Run npm run deploy:twilio-cli
  2. Encounter error:
Creating an optimized production build...
Failed to compile.

/Users/adamf/Dev/twilio/twilio-video-app-react/src/components/MainParticipant/MainParticipant.tsx
TypeScript error in /Users/adamf/Dev/twilio/twilio-video-app-react/src/components/MainParticipant/MainParticipant.tsx(11,26):
Type 'Participant' is not assignable to type 'LocalParticipant | RemoteParticipant'.
  Type 'Participant' is not assignable to type 'RemoteParticipant'.
    Types of property 'audioTracks' are incompatible.
      Type 'Map<string, AudioTrackPublication>' is not assignable to type 'Map<string, RemoteAudioTrackPublication>'.
        Type 'AudioTrackPublication' is not assignable to type 'RemoteAudioTrackPublication'.
          Property 'isSubscribed' is missing in type 'LocalAudioTrackPublication' but required in type 'RemoteAudioTrackPublication'.  TS2322

     9 |     /* audio is disabled for this participant component because this participant's audio 
    10 |        is already being rendered in the <ParticipantStrip /> component.  */
  > 11 |     <MainParticipantInfo participant={mainParticipant}>
       |                          ^
    12 |       <ParticipantTracks participant={mainParticipant} disableAudio enableScreenShare videoPriority="high" />
    13 |     </MainParticipantInfo>
    14 |   );

Environment

  • OS: macOS 10.15.3
  • Browser: N/A (Chrome)
  • App Version: 0.3.6
  • SDK Version: twilio-cli/1.10.0 darwin-x64 node-v12.16.1
  • Node.js version: 12.14.1 and 12.16.1

Additional context
Shell: zsh

First tried with yarn, then with npm -- ran into same issue at same step -- deleted node_modules between switching package managers.

same issue here

from twilio-video-app-react.

timmydoza avatar timmydoza commented on June 12, 2024 3

Hey everyone. Thanks for the info!

I am able to reproduce this issue when I run yarn install instead of npm install. However everything works correctly when I run npm install.

@ahmedmgh67 @osamaKu - Are you using yarn or npm to install dependencies? Does the app build correctly if you use npm?

It seems the problem has to do with the version of typescript installed. Npm will install version 3.7.5, because this is what is specified in the package-lock.json file.

Yarn ignores package-lock.json, and there is no yarn.lock file, so yarn installs a newer version of Typescript - version 3.8.3. This app hasn't yet been tested with version 3.8.3 of typescript and it seems to cause the above mentioned problems, which I'll look into this week.

If you still want to use yarn, try running the yarn import command. This will use package-lock.json to generate a yarn.lock file.

from twilio-video-app-react.

timmydoza avatar timmydoza commented on June 12, 2024 1

I'm glad it's working @adamfeldman! The Typescript 3.8.3 problems are something to look into - I've added a ticket to our backlog.

from twilio-video-app-react.

ahmedmgh67 avatar ahmedmgh67 commented on June 12, 2024

Same issue. Any updates from the twilio team?? @paynerc @kwhinnery @andrewryno

from twilio-video-app-react.

osamaKu avatar osamaKu commented on June 12, 2024

IN

src/components/MainParticipantInfo/MainParticipantInfo.tsx

add Participant type
interface MainParticipantInfoProps { participant: LocalParticipant | RemoteParticipant | Participant; children: React.ReactNode; }

And

src/components/ParticipantTracks/ParticipantTracks.tsx

add Participant type

interface ParticipantTracksProps { participant: LocalParticipant | RemoteParticipant | Participant; disableAudio?: boolean; enableScreenShare?: boolean; videoPriority?: Track.Priority; }

will throw another issue in

src/hooks/useScreenShareParticipant/useScreenShareParticipant.tsx

change Array type to any and parameter type to any in the find function

setScreenShareParticipant( Array.from<any>(room.participants.values()) // the screenshare participant could be the localParticipant .concat(room.localParticipant) .find((participant: any) => Array.from<TrackPublication>(participant.tracks.values()).find(track => track.trackName === 'screen') ) );

from twilio-video-app-react.

osamaKu avatar osamaKu commented on June 12, 2024

Hey everyone. Thanks for the info!

I am able to reproduce this issue when I run yarn install instead of npm install. However everything works correctly when I run npm install.

@ahmedmgh67 @osamaKu - Are you using yarn or npm to install dependencies? Does the app build correctly if you use npm?

It seems the problem has to do with the version of typescript installed. Npm will install version 3.7.5, because this is what is specified in the package-lock.json file.

Yarn ignores package-lock.json, and there is no yarn.lock file, so yarn installs a newer version of Typescript - version 3.8.3. This app hasn't yet been tested with version 3.8.3 of typescript and it seems to cause the above mentioned problems, which I'll look into this week.

If you still want to use yarn, try running the yarn import command. This will use package-lock.json to generate a yarn.lock file.

Hi @timmydoza

first I use yarn to install dependencies, I get this issue with typescript v 3.7.5, then I removed node_modules and yarn.lock, package-lock.json and tried with NPM, I get the same problem, I solved this issue as I explained above

from twilio-video-app-react.

adamfeldman avatar adamfeldman commented on June 12, 2024

TIL that yarn import exists. Thank you @timmydoza!

I was able to successfully build and deploy the project using the project's provided directions for npm. After doing so with npm, I was then also able to build and deploy the project by running yarn import then yarn run deploy:twilio-cli --override.

from twilio-video-app-react.

ccmouse avatar ccmouse commented on June 12, 2024

Same here. Cannot compile with identical error. Had to downgrade typescript to 3.7.5.

from twilio-video-app-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.