Ionic app seems to have stopped working and I am not able pinpoint the cause. I started again from blank app, but this error persists
Not sure if I am missing setup steps or issue with version mismatch? any pointers would help as I have wasted weeks on this issue
Accepted answers, like -
WebpackJsonp missing after Ionic 3 update or Ionic 2: ReferenceError: webpackJsonp is not defined have not worked
index.html has
<!-- The polyfills js is generated during the build process -->
<script src="build/polyfills.js"></script>
<!-- The vendor js is generated during the build process
It contains all of the dependencies in node_modules -->
<script src="build/vendor.js"></script>
<!-- The main bundle js is generated during the build process -->
<script src="build/main.js"></script>
ionic info -
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.1.8
Cordova Platforms : android 6.4.0 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
Node : v9.5.0
npm : 5.7.1
service.worker.js has-
// pre-cache our key assets
self.toolbox.precache(
[
'./build/main.js',
'./build/vendor.js',
'./build/main.css',
'./build/polyfills.js',
'index.html',
'manifest.json'
]
);
Related
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
<!-- cordova.js required for cordova apps (remove if not needed) -->
<!-- <script src="assets/ocw.js"></script> -->
<script src="cordova.js"></script>
<script src="assets/ocw.js"></script>
In desired file, declared variable as function name
called javascript function under, ionViewDidLoad
Ionic setup:
Ionic:
ionic (Ionic CLI) : 4.1.2 (/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
Xcode : Xcode 10.1 Build version 10B61
You need to export the function in your javascript file and then import it in your pagename.page.ts to be able to use it.
I am using ionic-3 and when I am compiling ionic project through ionic serve command, Its taking 4-6 mins for me.
Versions of following components:
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
#ionic/app-scripts : 2.1.4
Cordova Platforms : android 7.1.0
Ionic Framework : ionic-angular 3.7.1
System:
Android SDK Tools : 26.1.1
Node : v7.10.1
npm : 5.4.2
OS : Linux 4.4
Environment Variables:
ANDROID_HOME : /home/spaneos/Android/Sdk
Misc:
backend : pro
node version: 7.10.0
npm version: 5.4.2
It depends on your system specification. If you have a higher config machine then it will take less time. I hope you got the point.
I wanna implement ionic date time (https://ionicframework.com/docs/api/components/datetime/DateTime/)
to my project.
date time problem here are
But ı cannot see date time buttons. I don't understand what the actual problem is.
This is output of ionic info command.
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.1.8
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.9.2
System:
Node : v6.10.2
npm : 3.10.10
OS : macOS Sierra
Xcode : Xcode 8.2.1 Build version 8C1002
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : legacy
You can do this:
<ion-datetime displayFormat="hh:mm a" [(ngModel)]="myDate"></ion-datetime>
It will give time with format.
I hope it will help you.
Witout from option PostCSS could generate wrong source map or do not
find Browserslist config. Set it to CSS file path or to undefined to
prevent this warning
ionic3 project, when I running ionic corodva bulid ios --prod showing this warning for me.
ionic info
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
#ionic/app-scripts : 3.1.7
Cordova Platforms : android 6.3.0 ios 4.4.0
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
Node : v6.11.3
npm : 3.10.10
OS : macOS Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
UPDATE:
I tried to update my npm to 5.5.1 and node to 8.6.0, but still showing.
Finally, this warning solved. Thanks to Suraj Rao
First find sass.js file under /node_modules/#ionic/app-scripts/dist/sass.js.
inside search var postcssOptions and add from: undefined,
Finally should be like this:
var postcssOptions = {
from: undefined,
to: path_1.basename(sassConfig.outFile),
map: autoPrefixerMapOptions
};
Reference: workaround.
For whoever directly used PostCSS and met this issue then came here,
Change your
postcss( any_plugins ).process( css )
to
postcss( any_plugins ).process( css, { from: undefined } )
can fix the issue.
For me, adding map: { inline: false } solved my problem.
I'm trying to upload the App I built to my Ionic Pro account.
I've linked my account and added the SSH keys but after running ionic upload I'm getting this error
[ERROR] Sorry! The configured backend (pro) does not know about ionic upload.
This is My Ionic Info
cli packages: (/home/jos/Desktop/helloapp/node_modules)
#ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
Gulp CLI : not installed globally
local packages:
Cordova Platforms : android 6.2.3 browser 4.1.0
Ionic Framework : ionic1 1.3.1
System:
Android SDK Tools : 26.0.2
Node : v6.11.0
npm : 3.10.10
OS : Linux 3.13
ionic upload doesn't work with backend pro, you have to create an app
on https://dashboard.ionicjs.com/apps and there will be a setup guide :)