1

I am working on a React app with a MySQLdb and am trying to deploy with Heroku. I have followed a guide closely and am using JAWS DB hook to connect my db to Heroku. I am running into this error when I run the "heroku open" command after pushing to heroku:

"Error: Cannot find module '/app/node_modules/mime/mime.js'. Please verify that the package.json has a valid "main" entry"

My package.json has mime.js installed as a devDependency. I have set the "main" line in my package.json to "index.js" as well.

Repo: https://github.com/AndrewCodesDontYaKnow/ReactCalc

Anyone have any experience with this type of issue? Thanks much.

Andrew Smith
  • 483
  • 1
  • 3
  • 16
  • 1
    This might be helpful to you : https://stackoverflow.com/questions/59850705/how-to-deploy-react-application-to-heroku – Harshana Nov 10 '20 at 01:32
  • 1
    Thanks much, the instructions at this thread were able to get me deployed. Though now I'm working on getting my db connection working with JawsDB.. – Andrew Smith Nov 10 '20 at 16:58

1 Answers1

1

I just had the same problem with a different module ("telebot" in my case) I didn't figure out how to fix the issue (if anyone else finds this, I'd also like to know how to fix it), but I got it to work with a work around...

I copied the module source, and put it into my repo, and just used it as a local module...

(in my case I had by my .gitignore file ignore any "lib" folder, it gave me a hard time until i realized the lib folder from the telebot folder is just not getting uploaded to GitHub, and as such not getting to heroku, but after commenting it out, and getting it to upload, the local module worked as intended) also, I don't think this is an actual answer, but I don't have the rep to comment, so I hope this helps

LightWing
  • 88
  • 7