ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Ionic 2 RC2 Polyfill.js Argument not optional on Windows 10 mobile

Open mtycholaz opened this issue 10 years ago • 43 comments

Updated to the latest RC2, but I now get errors when deploying to the emulator/device.

Here's what I've tried

  1. ionic start test --v2
  2. ionic platform add windows
  3. npm run build --dev
  4. Open up CordovaApp.sln
  5. Set the device to mobile emulator and deploy image

And this is the error that happens in the Polyfill.js file Exception about Argument not optional

image

Here's what the package.json file has, but it's a vanilla project soo...

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "dependencies": {
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/core": "2.1.1",
    "@angular/forms": "2.1.1",
    "@angular/http": "2.1.1",
    "@angular/platform-browser": "2.1.1",
    "@angular/platform-browser-dynamic": "2.1.1",
    "@angular/platform-server": "2.1.1",
    "@ionic/storage": "1.1.6",
    "ionic-angular": "2.0.0-rc.2",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.21"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.39",
    "typescript": "2.0.6"
  },
  "description": "test: An Ionic project",
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": []
}

I've even stripped out everything to this, and it still get the error.

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
</head>
<body class="platform-windows platform-cordova platform-webview">
  <script src="build/polyfills.js"></script>
</body>
</html>

mtycholaz avatar Nov 05 '16 19:11 mtycholaz

ionic serve also gives this error in RC2. The application was working fine in RC1 and when I update it to RC2, I get this error. No changes made to the code.

jagansai avatar Nov 05 '16 22:11 jagansai

I am seeing the same thing...followed by:

Unable to get property '__symbol__' of undefined or null reference
in main.js

Windows 10, Edge.

morious avatar Nov 05 '16 23:11 morious

Yes, I have this too. Has to do with the Zones.js somehow? Workaround is currently to revert to RC 1

mtycholaz avatar Nov 06 '16 00:11 mtycholaz

Don't revert to RC1. It works fine in Chrome. Looks like an issue with Edge or non-standard behavior tailored for chrome ( which is the case these days ). If you need to test it for Windows Phone then no other option but to revert to RC1.

jagansai avatar Nov 06 '16 01:11 jagansai

Yah, I don't have any other option, but reverting. I utilize WinRT API's that don't exist in Chrome, or have Cordova plugins. My workflow is make a code change, compile with cli, build in Visual Studio, and then deploy to either a device or emulator.

Until Windows 10 UWP gets more attention from developers, this is just how it is.

mtycholaz avatar Nov 06 '16 02:11 mtycholaz

Related to #9025

mpaland avatar Nov 06 '16 12:11 mpaland

I have this problem too. Does anyone have any idea?

SergeyRolich avatar Nov 08 '16 20:11 SergeyRolich

It's definitely a problem in Edge. Even viewing the online documentation doesn't work with the side preview. Either develop in chrome until it's fixed, or revert.

mtycholaz avatar Nov 08 '16 21:11 mtycholaz

Which Edge version? Edge 13 seems to work fine.

infinnie avatar Nov 09 '16 00:11 infinnie

Edge 14? Seems that the problem has something to do with window.fetch() that Edge throws a synchronous error when called without arguments instead of an asynchronous one (a rejected Promise) like Firefox or Chrome would do.

Shim this method before including the polyfills might solve the problem.

infinnie avatar Nov 09 '16 00:11 infinnie

I'm running Edge 14. RC1 didn't have this issue with Edge 14, so it was something changed in Polyfill.js

mtycholaz avatar Nov 09 '16 01:11 mtycholaz

@mtycholaz See my second comment.

infinnie avatar Nov 09 '16 03:11 infinnie

Interesting, I'll try that.

mtycholaz avatar Nov 09 '16 04:11 mtycholaz

Hello all! I am looking into this issue today. It seems that edge's implementation of the fetch api is different than other browsers (chrome, firefox, opera) which is causing an issue with the polyfills.

jgw96 avatar Nov 09 '16 15:11 jgw96

Is anyone here running a nightly build of edge? If so does this issue still happen in that nightly build?

jgw96 avatar Nov 09 '16 15:11 jgw96

I can confirm Edge 15 on Windows 10 mobile has this issue, along with Edge 14 anniversary edition.

mtycholaz avatar Nov 09 '16 16:11 mtycholaz

However, in Edge 13 everything works.

mtycholaz avatar Nov 09 '16 16:11 mtycholaz

Running actual Edge 14.14393 with RC2. Doesn't work! Can confirm, RC1 with @angular/xxx 2.1.1 is fine.

mpaland avatar Nov 09 '16 18:11 mpaland

I am not sure Edge has nightly build. If there is, please help me with the link. I am running Windows Insider Build 14965 ( latest ). It still does not work in the Edge version that comes with that build.

jagansai avatar Nov 10 '16 23:11 jagansai

Edge 13.10586 (Threshold) - Works Edge 14.14393 Desktop (Anniversary edition) - Error Edge 14.14393 Mobile (Anniversary edition) - Error Edge 15.14955 Mobile (Insider build) - Error

mtycholaz avatar Nov 11 '16 20:11 mtycholaz