react-select: Uncaught Error: Cannot find module 'create-react-class'

Uncaught Error: Cannot find module 'create-react-class'
    at s (react-select.js:1)
    at react-select.js:1
    at Object.<anonymous> (react-select.js:823)
    at Object.5../Async (react-select.js:2038)
    at s (react-select.js:1)
    at e (react-select.js:1)
    at react-select.js:1
    at react-select.js:1
    at react-select.js:1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 12
  • Comments: 18 (1 by maintainers)

Most upvoted comments

Same issue as @aluskin and @azotova. Also found that reverting to react-select@1.0.0-rc.3 and react-input-autosize@1.1.0 with react@15.5.4 solves the issue.

@agirton Thanks for looking into this! I use the builds from CDN:

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react-with-addons.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/classnames/2.2.5/index.js"></script>
<script src="https://npmcdn.com/react-input-autosize/dist/react-input-autosize.js"></script>
<script src="https://npmcdn.com/react-select/dist/react-select.js"></script>

I get two error messages:

  1. Uncaught Error: Cannot find module ‘react’ (this comes from react-input-autosize, I described the issue with react in a comment here: JedWatson/react-input-autosize#84 )
  2. Uncaught Error: Cannot find module ‘create-react-class’ from react-select.

My temporary fix is to use the previous versions of react-select and react-input-autosize (in this way I get react warnings but at least everything works):

script(src="https://npmcdn.com/react-input-autosize@1.1.0/dist/react-input-autosize.js")
script(src="https://npmcdn.com/react-select@1.0.0-rc.3/dist/react-select.js")

Thanks, I will need to update the README, but you will need to include create-react-class and prop-types from the CDN if you don’t use a module bundler.