herokuisomorphic-javascriptwalmart-electrode

Heroku build succeeds but deploy fails (no code change)


I'm getting the following error in LogDNA:

(node:28) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cannot find module '/tmp/build_[long-hash]/my-project-[long-hash]/node_modules/bluebird'
Process exited with status 0
State changed from starting to crashed

That line contains an import of Bluebird. When I remove the dependency and remove the line, then I get the same error, except it references the next line (which is also a dependency import).

When I deploy a branch that was previously working, I get the same error. Of course, I cannot re-pro this issue locally.

I compared the Dyno's npm list against my local, and they're the same. Also, all of the expected node_modules are, in fact, present in the Dyno's filesystem.

If I use Heroku-bash run the build task manually (with nothing special), then deploy, it's fine.


Solution

  • We had hard-coded/fixed the version of Electrode we're depending on, but Electrode has a fuzzy version for WebPack, which released a new version 5 days ago that caused this error. It causes the imports' paths to be incorrectly resolved/transpiled to the build directory instead of remain relative.

    The workaround is to use require() instead of import.