reactjs - React/webpack application deploy fails on heroku -


i trying deploy react starter on heroku. have written webpack file , works on localhost deploy on heroku throws run time error of: cannot find module '../lib/util/adddevserverentrypoints'

my stacktrace looks like

error: cannot find module '../lib/util/adddevserverentrypoints' 2017-03-28t11:56:47.036328+00:00 app[web.1]: @ function.module._resolvefilename (module.js:469:15) 2017-03-28t11:56:47.036329+00:00 app[web.1]: @ function.module._load (module.js:417:25) 2017-03-28t11:56:47.036329+00:00 app[web.1]: @ module.require (module.js:497:17) 2017-03-28t11:56:47.036330+00:00 app[web.1]: @ require (internal/module.js:20:19) 2017-03-28t11:56:47.036330+00:00 app[web.1]: @ object. (/app/node_modules/webpack-dev-server/bin/webpack-dev-server.js:9:33) 2017-03-28t11:56:47.036331+00:00 app[web.1]: @ module._compile (module.js:570:32) 2017-03-28t11:56:47.036331+00:00 app[web.1]: @ object.module._extensions..js (module.js:579:10) 2017-03-28t11:56:47.036332+00:00 app[web.1]: @ module.load (module.js:487:32) 2017-03-28t11:56:47.036333+00:00 app[web.1]: @ trymoduleload (module.js:446:12) 2017-03-28t11:56:47.036333+00:00 app[web.1]: @ function.module._load (module.js:438:3)

i have faced similar problems while deploying app in heroku.

it's best write node express server serves public folder deploy app rather using webpack-dev-server.

node express server can created following.

const express = require('express') const path = require('path') const app = express() app.use(express.static(path.resolve(__dirname,'dist') app.listen(process.env.port || 8080) 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -