I'm using Rails 5.1 with the Webpacker configuration that is now by default integrated in Rails. I've followed this article "Rails 5.1 loves Javascript" to get me on the right track.
So far so good. If run rails s
on a shell and ./bin/webpack-dev-server --host 127.0.0.1
I can work on the application locally on my desktop.
The issue appears when I try to debug on iphone via my local wifi.
The phone can connect to the local machine via port 3000 and browse the entire application, but apparently it cannot find 127.0.0.1:8080
server and therefore the webpack bundle. Infact it throws this error:
Failed to load resources: cannot connect to server http://127.0.0.1:8080/packs/application.js
I've already tried running ./bin/webpack-dev-server --host 0.0.0.0
but I get the same error.
How do I need to set webpack-dev-server so Rails can load webpack resources?
I've also opened an issue on the official github of rails/webpacker.