Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

SyntaxError: Unexpected token: name (WebTorrentRemoteClient) #5818

Closed
luixxiul opened this issue Nov 23, 2016 · 11 comments
Closed

SyntaxError: Unexpected token: name (WebTorrentRemoteClient) #5818

luixxiul opened this issue Nov 23, 2016 · 11 comments

Comments

@luixxiul
Copy link
Contributor

Describe the issue you encountered:

By running a build script the following error happens and the packaged build does not start.

ERROR in webtorrentPage.entry.js from UglifyJs
SyntaxError: Unexpected token: name (WebTorrentRemoteClient) [./~/webtorrent-remote/client.js:10,0]

From Terminal when I try to open the program, I get this.

Brave-MacBook-Pro:browser-laptop Suguru$ open ./Brave-darwin-x64/Brave.app
LSOpenURLsWithRole() failed with error -10810 for the file /Users/Suguru/browser-laptop/Brave-darwin-x64/Brave.app.
  • Platform (Win7, 8, 10? macOS? Linux distro?): macOS

  • Brave Version: master branch

  • Any related issues:

@luixxiul luixxiul added the bug label Nov 23, 2016
@luixxiul luixxiul added this to the 0.13.0 milestone Nov 23, 2016
@luixxiul
Copy link
Contributor Author

ccing @feross @dcposch for thought.

@dcposch
Copy link
Contributor

dcposch commented Nov 24, 2016

Just to confirm, you ran npm install first, right?

Do you see a webtorrent-remote folder under node_modules?

@luixxiul
Copy link
Contributor Author

@dcposch yes I did and I see the folder. @bsclifton has noticed the error too if I remember correctly.

@luixxiul
Copy link
Contributor Author

FYI the issue does not happen if I run the browser via npm run watch and npm start. For me it happens on the packaged build only.

@dcposch
Copy link
Contributor

dcposch commented Nov 24, 2016

Yes, I see it too now.

$ CHANNEL=dev npm run build-package
...
ERROR in webtorrentPage.entry.js from UglifyJs
    SyntaxError: Unexpected token: name (WebTorrentRemoteClient) [./~/webtorrent-remote/client.js:10,0]

Sorry about that! Trying to fix it now.

@dcposch
Copy link
Contributor

dcposch commented Nov 24, 2016

Narrowed it down a bit:

Works

CHANNEL=dev ./node_modules/.bin/webpack

Doesn't work

NODE_ENV=production CHANNEL=dev ./node_modules/.bin/webpack

...& that's what the packager script does.

@dcposch
Copy link
Contributor

dcposch commented Nov 24, 2016

OK, here's what might be happening:

  • When NODE_ENV=production, we use Uglify
  • Uglify doesn't like the ES6 features, specifically class, that we're using in webtorrent-remote

@dcposch
Copy link
Contributor

dcposch commented Nov 24, 2016

I'm changing webtorrent-remote to not use class. Almost done

@dcposch
Copy link
Contributor

dcposch commented Nov 25, 2016

I removed all ES6 from webtorrent-remote and the build is working for me now. See #5847

@luixxiul
Copy link
Contributor Author

luixxiul commented Nov 26, 2016

That error disappears for me too, but LSOpenURLsWithRole() failed with error -10810 still happens. Maybe another thing is related here, cc: @bbondy

I opened another issue for that: #5849

@luixxiul
Copy link
Contributor Author

I added release-notes/exclude as the bug appeared and was fixed within the same milestone.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants