missive / emoji-mart

🏪 One component to pick them all
https://missiveapp.com/open/emoji-mart
MIT License
8.7k stars 835 forks source link

Unable to create build when using in react. #371

Closed aahish closed 4 years ago

aahish commented 5 years ago

When using nimblePicker and picker component from dist-es and dist-modern SyntaxError: Unexpected token: punc ({) [./~/emoji-mart/dist-es/index.js:1,0]

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! reactjs-crud-boilerplate@0.0.2 build: react-scripts build npm ERR! Exit status 1

When using nimblePicker and picker component from dist SyntaxError: Unexpected token: operator (>) [./~/emoji-mart/dist/components/emoji/nimble-emoji.js:29,0]

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! reactjs-crud-boilerplate@0.0.2 build: react-scripts build npm ERR! Exit status 1 npm ERR!

image

nolanlawson commented 4 years ago

The purpose of dist-es and dist-modern is to offer slightly lower compatibility while offering improved performance with some bundlers. If it's not working with your bundler/node version/etc. then you should be able to use the regular dist package.

Based on the output shown, it looks like the issue is that you are using an older version of UglifyJS which does not support some of the syntax in dist-es or dist-modern.