Module not found Error when deployed on Heroku

前端 未结 5 1624
感动是毒
感动是毒 2021-02-14 14:09

I am trying to deploy my app on Github to Heroku but getting error:

ERROR in ./src/Index.tsx Module not found: Error: Can\'t resolve \'./ConfigureStore\

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-14 14:45

    For some reason i just added this

    "heroku-prebuild": "export NPM_CONFIG_PRODUCTION=false; export NODE_ENV=; NPM_CONFIG_PRODUCTION=false NODE_ENV=development npm install --only=dev --dev",
    "heroku-postbuild": "export NPM_CONFIG_PRODUCTION=true; export NODE_ENV=production;
    

    I got it from this answer

    by default, heroku removes your packages under devDependencies after build. Something in your app probably depends on the packages specified on devDependencies. The npm scripts above skips purging the devDependencies.

提交回复
热议问题