twilio / twilio-video-app-react

A collaboration application built with the twilio-video.js SDK and React.js
Apache License 2.0
1.81k stars 728 forks source link

Failed to compile #330

Closed VGordillo-Resulto closed 4 years ago

VGordillo-Resulto commented 4 years ago

Description I have tried to compile the application right after downloading the application. I have not modified any files yet.

  Line 11:61:  Parsing error: Unexpected token, expected ","

   9 | 
  10 | export default function useRoom(localTracks: LocalTrack[], onError: Callback, options?: ConnectOptions) {
> 11 |   const [room, setRoom] = useState<Room>(new EventEmitter() as Room);
     |                                                             ^
  12 |   const [isConnecting, setIsConnecting] = useState(false);
  13 |   const optionsRef = useRef(options);
  14 | 

To Reproduce

  1. Clone from git
  2. npm install
  3. npm run build

Environment (please complete the following information):

Log

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using npm@6.13.4
3 info using node@v12.14.1
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle twilio-video-app-react@0.2.0~prebuild: twilio-video-app-react@0.2.0
6 info lifecycle twilio-video-app-react@0.2.0~build: twilio-video-app-react@0.2.0
7 verbose lifecycle twilio-video-app-react@0.2.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle twilio-video-app-react@0.2.0~build: PATH: [...]
9 verbose lifecycle twilio-video-app-react@0.2.0~build: CWD: C:\twilio-video-app-react
10 silly lifecycle twilio-video-app-react@0.2.0~build: Args: [ '/d /s /c', 'node ./scripts/build.js' ]
11 silly lifecycle twilio-video-app-react@0.2.0~build: Returned: code: 1  signal: null
12 info lifecycle twilio-video-app-react@0.2.0~build: Failed to exec build script
13 verbose stack Error: twilio-video-app-react@0.2.0 build: `node ./scripts/build.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:223:5)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:223:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid twilio-video-app-react@0.2.0
15 verbose cwd C:\Users\Víctor\Desktop\NODE\twilio-video-app-react
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build"
18 verbose node v12.14.1
19 verbose npm  v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error twilio-video-app-react@0.2.0 build: `node ./scripts/build.js`
22 error Exit status 1
23 error Failed at the twilio-video-app-react@0.2.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
timmydoza commented 4 years ago

Thanks for the bug report @VGordillo-Resulto!

Unfortunately, I'm not able to reproduce the issue you described. I tried the steps you described on a MacOS and a Windows 10 machine, and I was able to successfully build the app both times.

I found an issue reported on Stack Overflow where a user encountered the same error as you did, also in a create-react-app application. The issue is here: https://stackoverflow.com/questions/60547153/eslint-parsing-error-unexpected-token-on-typescript-cast-operator-as

One user stated in their solution: "I had to correct PATH and make sure workspace folders are detected correctly."

Maybe your app is using a configuration that might be available in a parent directory? Also, in your error message, line 9 shows that the CWD is C:\twilio-video-app-react, but line 15 shows the CWD as C:\Users\Víctor\Desktop\NODE\twilio-video-app-react. I'm not sure what this would mean, but perhaps it's clue.

Sorry I couldn't be of more help. Hopefully the stack overflow issue will point you in the right direction.

In the meantime, I'll close this issue, as it appears that the bug does not exist in this app. But please do let me know if you have any other questions. Good luck!