Meteor run on device fails with "No 'Access-Control-Allow-Origin' header is present"

Today, when I attempt to run my app on Android device, I am suddenly seeing:

chromium: [INFO:CONSOLE(0)] “Failed to load
http://192.168.178.26:3000/sockjs/info?cb=n4yqw4dcee: No
‘Access-Control-Allow-Origin’ header is present on the requested
resource. Origin ‘http://localhost:12120’ is therefore not allowed
access. The response had HTTP status code 503.”, source:
http://localhost:12120/ (0)

and the app is unable to connect to my server.

Previous to that, I see this in the server log:

I20180618-10:40:59.967(2)? 06-18 10:40:48.168 17140 17176 E chromium: [ERROR:devtools_http_handler.cc(292)] Cannot start http server for devtools. Stop devtools.
I20180618-10:40:59.970(2)? 06-18 10:40:48.598 17140 17140 I MeteorWebApp: Serving asset bundle with version: 929554c42289486da3223131a986edcf81489cbc
I20180618-10:40:59.974(2)? 06-18 10:40:50.208 17140 17184 E chromium: [ERROR:budget_service.cc(160)] Unable to connect to the Mojo BudgetService.

Why?

Hi, do you have these lines in mobile-config.js?

App.accessRule('http://*');
App.accessRule('https://*');

Thanks. Yes, I tried just about everything, and then I remembered… I had deactivated wifi on my device! Once I was back on the LAN, order was cheerfully restored.

1 Like