Ionic CLI Service Proxies broken?

I feel pretty stupid right now: Service Proxies seem not to be working for me right now.

I copy the example from here to my ionic.config.json:
https://github.com/ionic-team/ionic-cli/blob/master/README.md#service-proxies

  "proxies": [
    {
      "path": "/v1",
      "proxyUrl": "https://api.instagram.com/v1"
    }
  ]

Then I run ionic serve:

> ionic serve -b
[INFO] Starting app-scripts server: --nobrowser --b --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address
       0.0.0.0 - Ctrl+C to cancel
[15:37:53]  watch started ...
[15:37:53]  build dev started ...
[15:37:53]  clean started ...
[15:37:53]  clean finished in 9 ms
[15:37:53]  copy started ...
[15:37:53]  transpile started ...
[15:37:57]  transpile finished in 4.41 s
[15:37:57]  preprocess started ...
[15:37:57]  deeplinks started ...
[15:37:57]  deeplinks finished in 86 ms
[15:37:57]  Proxy added:/v1 => https://api.instagram.com/v1
[15:37:58]  preprocess finished in 360 ms
[15:37:58]  webpack started ...
[15:37:58]  copy finished in 4.98 s
[15:38:16]  webpack finished in 18.56 s
[15:38:16]  sass started ...
[15:38:20]  sass finished in 3.51 s
[15:38:20]  postprocess started ...
[15:38:20]  postprocess finished in 11 ms
[15:38:20]  lint started ...
[15:38:20]  build dev finished in 26.92 s
[15:38:20]  watch ready in 27.11 s
[15:38:20]  dev server running: http://localhost:8100/

[INFO] Development server running
       Local: http://localhost:8100

[15:38:25]  lint finished in 5.54 s

You see that it recognizes the proxy config.

Still, when I request e.g. http://localhost:8100/v1/foo I only get a white page, constructed from this HTML:

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>

  <!-- Ionic Dev Server: Injected Logger Script -->
  <script>var IonicDevServerConfig={"sendConsoleLogs":false,"wsPort":53703,"appScriptsVersion":"2.0.0","systemInfo":["Ionic Framework: 3.5.0","Ionic App Scripts: 2.0.0","Angular Core: 4.1.3","Angular Compiler CLI: 4.1.3","Node: 8.1.3","OS Platform: Windows 10"]};</script>
  <link href="__ion-dev-server/ion-dev.css?v=2.0.0" rel="stylesheet">
  <script src="__ion-dev-server/ion-dev.js?v=2.0.0"></script>
  
  <script data-ionic="inject">
    (function(w){var i=w.Ionic=w.Ionic||{};i.version='3.5.0';i.angular='4.1.3';i.staticDir='build/';})(window);
  </script>
  <meta charset="UTF-8">
  <title>Ionic App</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highlight" content="no">

  <link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
  <link rel="manifest" href="manifest.json">
  <meta name="theme-color" content="#4e8ef7">

  <!-- cordova.js required for cordova apps -->
  <script src="cordova.js"></script>

  <!-- un-comment this code to enable service worker
  <script>
    if ('serviceWorker' in navigator) {
      navigator.serviceWorker.register('service-worker.js')
        .then(() => console.log('service worker installed'))
        .catch(err => console.error('Error', err));
    }
  </script>-->

  <link href="build/main.css" rel="stylesheet">

</head>
<body>

  <!-- Ionic's root component and where the app will load -->
  <ion-app></ion-app>

  <!-- The polyfills js is generated during the build process -->
  <script src="build/polyfills.js"></script>

  <!-- all code from node_modules directory is here -->
  <script src="build/vendor.js"></script>

  <!-- The bundle js is generated during the build process -->
  <script src="build/main.js"></script>

  <!-- Ionic Dev Server: Injected LiveReload Script -->
  <script src="//localhost:35729/livereload.js?snipver=1" async="" defer=""></script>
</body>
</html>

Am I missing something?

My ionic info:

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 2.0.0
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : android 6.2.3
Ionic Framework                 : ionic-angular 3.5.0

System:

Node       : v8.1.3
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 5.0.3

(Also tried with @ionic/cli-plugin-proxy installed globally, no change)

@LoLStats forwarded me this issue via Slack:

So expected bug in @ionic/app-scripts 2.0.0 right now :frowning:

It’s already fixed, but not released yet.

1 Like

And 2.0.1 with a fix is out:

https://github.com/ionic-team/ionic-app-scripts/releases/tag/v2.0.1