question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected token: name (onClickOutside)

See original GitHub issue

Getting an error on webpack production build.

Unexpected token: name (onClickOutside) [./node_modules/react-onclickoutside/index.js:92,0]

It seems to be fixed in react-onclickoutside version 6.1.0 as mentioned here.

https://github.com/Pomax/react-onclickoutside/issues/195

I noticed this has recently been downgraded, but version 0.57.0 won’t build for me and others.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:42 (19 by maintainers)

github_iconTop GitHub Comments

6reactions
firec0dercommented, Oct 26, 2017

I’m experiencing the same issue with the create-react-app stack. It can’t build my application, fails with the message:

image

6reactions
amarinovcommented, Oct 26, 2017

@martijnrusschen Seems to me this is a different problem you’ve fixed with downgrading react-onclickoutside to 6.0.0.

The problem I, @tadjohnston and @josegers have is that, ./node_modules/react-onclickoutside/index.js in v6.0.0 is not transpiled and has native ES6 class defined. This is sth that has been fixed in react-onclickoutside v.6.1.0, but you’re using a lower version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot fix "Unexpected token name «i», expected punc «;»"
According to forums, the problem is caused because UglifyJs does not support ES6 so I tried to solve it with these links: this...
Read more >
syntaxerror: unexpected token 'export' uuid - You.com | The AI ...
This means, that a file is not transformed through TypeScript compiler, e.g. because it is a JS file with TS syntax, or it...
Read more >
react-onclickoutside-es6 - npm package - Snyk
Learn more about react-onclickoutside-es6: package health score, popularity, security, maintenance, ... Uncaught SyntaxError: Unexpected token import.
Read more >
Magento 2.4.2: SyntaxError: Unexpected token: name (url)
It appears you have some Javascript that is using ES6 or newer syntax and the version of UglifyJS does not support this.
Read more >
react-bootstrap-typeahead - npm
By default, the key is named label , but you can specify a ... You may have unexpected results if your data contains...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found