Home > Net >  Build successful when deploying web application on heroku but can not view site because I get an err
Build successful when deploying web application on heroku but can not view site because I get an err

Time:04-21

[message from Heroku error log][1]

$ heroku logs --tail Error: Cannot find module './toString' Require stack:

  • C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/lodash/capitalize.js
  • C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/@heroku-cli/plugin-run/node_modules/cli-ux/lib/styled/table.js
  • C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/@heroku-cli/plugin-run/node_modules/cli-ux/lib/index.js
  • C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/@heroku-cli/plugin-run/lib/lib/log-displayer.js
  • C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/@heroku-cli/plugin-run/lib/commands/logs.js
  • C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/@oclif/config/lib/plugin.js
  • C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/@oclif/config/lib/config.js
  • C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/@oclif/config/lib/index.js
  • C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/@oclif/command/lib/command.js- C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/@oclif/command/lib/index.js
  • C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/bin/run at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:999:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (C:/Users/esraw/AppData/Roaming/npm/node_modules/heroku/node_modules/lodash/capitalize.js:1:16) at Module._compile (node:internal/modules/cjs/loader:1097:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10) at Module.load (node:internal/modules/cjs/loader:975:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:999:19)

CodePudding user response:

I have had this issue in the past and it was pretty annoying for me as well. It seems like heroku cannot find a node module. I don't know if this would work for you, but in your .gitignore make sure you remove /node_modules. I think the issue is that heroku cannot find the node module.

CodePudding user response:

Please check your package.json file. If you found any code under devDependencies. Move them under the dependencies section.

  • Related