mars / create-react-app-buildpack

⚛️ Heroku Buildpack for create-react-app: static hosting for React.js web apps
MIT License
3.28k stars 653 forks source link

Module not found: Error: Can't resolve 'react-responsive-modal' in '/tmp/build_xxxxx/src/components' #109

Closed JadeHayes closed 6 years ago

JadeHayes commented 6 years ago

Hello all, I'm new to buildpack and deploying in general so apologies if I don't have enough details on this issue. When I run git push heroku master, it runs and I get remote: -----> Build succeeded!

Then when it gets to the buildpack portion, I get an error because of a react-responsive-modal.


remote: > mysite@0.1.0 build /tmp/build_3525a003d4621bf4512bfd8fbf87bc8c
remote: > react-scripts build
remote: 
remote: Creating an optimized production build...
remote: Failed to compile.
remote: 
remote: Module not found: Error: Can't resolve 'react-responsive-modal' in '/tmp/build_3525a003d4621bf4512bfd8fbf87bc8c/src/components'

I've npm installed react-responsive-modal and can confirm it in my package.json under dependencies "react-responsive-modal": "^3.0.3"

Any help is very much appreciated!

mars commented 6 years ago

If a module is reported missing, then it is not being installed as expected.

How did you install it? Did you npm install react-responsive-modal --save? Is the current package.json committed & pushed for deployment?

Does it work locally? If so, there’s some inconsistency between what is local vs committed to git.

JadeHayes commented 6 years ago

I just figured out that it was installed but I didn't git commit after the installation to update the package json... rookie mistake. Thank you!