React-select: Bug, npm fails to minify with create-react-app

Created on 10 Sep 2017  路  7Comments  路  Source: JedWatson/react-select

https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify

You may occasionally find a package you depend on needs compiled or ships code for a non-browser environment.
This is considered poor practice in the ecosystem and does not have an escape hatch in Create React App.

To resolve this:

Open an issue on the dependency's issue tracker and ask that the package be published pre-compiled (retaining ES6 Modules).

Most helpful comment

import Select from 'react-select/dist/react-select'

Am able to bypass error by doing this import instead for now

All 7 comments

Failed to minify the code from this file: 

        ./node_modules/react-select/lib/Select.js:39 

https://github.com/JedWatson/react-select/blob/master/lib/Select.js#L39

import Select from 'react-select/dist/react-select'

Am able to bypass error by doing this import instead for now

Thanks @Geczy,

At least now I can try it :)

Closing as a duplicate of #1971

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MindRave picture MindRave  路  3Comments

ericj17 picture ericj17  路  3Comments

sampatbadhe picture sampatbadhe  路  3Comments

MalcolmDwyer picture MalcolmDwyer  路  3Comments

pablote picture pablote  路  3Comments