ionic-team / ionic-v3

The repo for Ionic 3.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
128 stars 85 forks source link

Getting : Uncaught TypeError: t.resolve is not a function #323

Open ionitron-bot[bot] opened 5 years ago

ionitron-bot[bot] commented 5 years ago

Original issue by @HamzaLJ on 2017-11-19T19:19:29Z

Ionic version: (check one with "x") (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [ X ] 3.x [ ] 4.x

I'm submitting a ... (check one with "x") [ X ] bug report [ ] feature request

Current behavior: When running ionic serve on the browser if I do a right click, I get the following :

polyfills.js:3 Uncaught TypeError: t.resolve is not a function
    at Object.setNativePromise (polyfills.js:3)
    at L.configurable.L.set (polyfills.js:3)
    at new Synchronizetion (index.js:37)
    at handleEvent (index.js:106)
    at t.invokeTask (polyfills.js:3)
    at r.runTask (polyfills.js:3)
    at e.invokeTask [as invoke] (polyfills.js:3)
    at p (polyfills.js:2)
    at d (polyfills.js:2)

Expected behavior: It shouldn't throw the error.

Steps to reproduce: Just do a right click and you'll get the error.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 3.0.1
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.8.0

System:

    ios-deploy : 1.9.2 
    ios-sim    : 6.0.0 
    Node       : v8.1.3
    npm        : 5.4.2 
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.3 Build version 8E3004b 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy
girish-fuluskar commented 5 years ago

Hi,

Did you find any solution? I am also facing same issue.

My use case:

Call JavaScript function from JS file (included in project) in Ionic 4 on particular page.

I'm having following issue.

ERROR TypeError: t.resolve is not a function at Object.setNativePromise (polyfills.js:3) at L.configurable.L.set (polyfills.js:3) at n.exports (ocw.js:4850) at a (ocw.js:4850) at Object.209.100 (ocw.js:4851) at s (ocw.js:4850) at ocw.js:4850 at Object.327.131 (ocw.js:4852) at s (ocw.js:4850) at ocw.js:4850 Steps followed:

Included JS file under src->assets added reference in index.html after cordova.js file

Run code snippetExpand snippet In desired file, declared variable as function name called javascript function under, ionViewDidLoad Ionic setup:

Ionic:

ionic (Ionic CLI) : 4.7.1 (/usr/local/lib/node_modules/ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.0.0 Cordova Platforms : android 6.4.0, ios 4.5.5 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.0.2, (and 9 other plugins)

System:

ios-deploy : 1.9.2 ios-sim : 6.0.0 NodeJS : v8.12.0 (/usr/local/bin/node) npm : 6.4.1 OS : macOS Mojave Xcode : Xcode 10.1 Build version 10B61

ovpv commented 4 years ago

Did anyone solve this issue?? I am stuck with this error and there is no solution found online!! Please help!!

TypeError: t.resolve is not a function
    at Object.setNativePromise (http://localhost:8100/build/polyfills.js:3:18280)
    at L.configurable.L.set (http://localhost:8100/build/polyfills.js:3:23002)
    at module.exports (http://localhost:8100/build/vendor.js:170558:12)
    at $export (http://localhost:8100/build/vendor.js:170321:17)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:172252:1)
    at __w_pdfjs_require__ (http://localhost:8100/build/vendor.js:168953:30)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:171830:1)
    at __w_pdfjs_require__ (http://localhost:8100/build/vendor.js:168953:30)
    at checkPromise (http://localhost:8100/build/vendor.js:170161:27)
    at Object.<anonymous> (http://localhost:8100/build/vendor.js:170162:5)
kiag0 commented 4 years ago

Had the same problem and I figured out a dumb solution. Everytime before serving (ionic serve), i did a npm i on the project and the error did not appear - but Subsequent ionic serve would show the error though. So everytime I needed to build I'd npm i and there would be no error. Its damn and might not work for everyone but helped me beat a critical deadline