Picland / v3-frontend

muwenzi v3: frontend including node.js server
https://sandbox.muwenzi.com/
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

[Webpack] error on the browser screen does not work #5

Open Kimi-Gao opened 7 years ago

Kimi-Gao commented 7 years ago

Now, the error(this is not i wanted error) shows in console not the browser screen:

image

and the iTerm shows this error correctly:

image

it should show on the browser screen too and will auto reload when i fix it.

I think it almost caused by React SSR, because the page lost the structure of DOM when got the errors. see those relevant articles:

Kimi-Gao commented 7 years ago

now, it works when code has some error, but does not work when code has no error after I change some code

Kimi-Gao commented 7 years ago

at present, it can work(show error on screen) when code has some issue, but do not work when I fix the issue. It shows this error on browser console: image needs to refresh the browser

Kimi-Gao commented 7 years ago

node_modules/webpack/lib/JsonpMainTemplate.runtime.js Line48:

image

request.responseText returns a html string, not json, so it made error. google webpack JSON.parse(request.responseText)

https://github.com/webpack/webpack-dev-middleware/issues/68 https://github.com/webpack/webpack-dev-middleware https://github.com/glenjamin/webpack-hot-middleware https://webpack.github.io/docs/webpack-dev-server.html#combining-with-an-existing-server