paulsutherland / Polyonic

An Electron Ionic application shell for creating Web Apps, Progressive Mobile Web Apps, Native Mobile Apps and Desktop Apps.
209 stars 44 forks source link

Can't build #4

Closed npjonath closed 7 years ago

npjonath commented 7 years ago

Hello, Your project look great ! But it seams I can't build it.

all package was installed according to the ReadMe.

Failed to load resource: the server responded with a status of 404 (Not Found) main.css Failed to load resource: the server responded with a status of 404 (Not Found) main.js:73884 Uncaught Error: Cannot find module "ionic-native" at Object. (main.js:73884) at webpack_require (main.js:20) at Object. (main.js:73637) at webpack_require (main.js:20) at Object. (main.js:112944) at __webpack_require__ (main.js:20) at main.js:66 at main.js:69 main.css Failed to load resource: the server responded with a status of 404 (Not Found)

Thanks !

npjonath commented 7 years ago

Ok I correct the issue.

It missing some package on root : npm install --save rollup on src: npm install --save ionicons

update add.module.ts with new @ionic-native import

import { NgModule, ErrorHandler } from '@angular/core' import { BrowserModule } from '@angular/platform-browser' import { HttpModule } from '@angular/http' import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular' import { MyApp } from './app.component' import { AboutPage } from '../pages/about/about' import { ContactPage } from '../pages/contact/contact' import { HomePage } from '../pages/home/home' import { TabsPage } from '../pages/tabs/tabs' import {StatusBar} from "@ionic-native/status-bar"; import {SplashScreen} from "@ionic-native/splash-screen";

@NgModule({ declarations: [ MyApp, AboutPage, ContactPage, HomePage, TabsPage ], imports: [ BrowserModule, HttpModule, IonicModule.forRoot(MyApp),

], bootstrap: [IonicApp], entryComponents: [ MyApp, AboutPage, ContactPage, HomePage, TabsPage ], providers: [ {provide: ErrorHandler, useClass: IonicErrorHandler}, StatusBar, SplashScreen ] }) export class AppModule {}`

update app.component.ts

import { Component } from '@angular/core' import { Platform } from 'ionic-angular'

import { TabsPage } from '../pages/tabs/tabs' import {StatusBar} from "@ionic-native/status-bar"; import {SplashScreen} from "@ionic-native/splash-screen";

@Component({ templateUrl: 'app.html' }) export class MyApp { rootPage = TabsPage

constructor(platform: Platform, private StatusBar:StatusBar, private SplashScreen:SplashScreen) { platform.ready().then(() => { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need. StatusBar.styleDefault(); SplashScreen.hide(); }) } }

paulsutherland commented 7 years ago

@npjonath Thanks for getting in touch. I was running locally on my original repo and obviously did not have ionicons and rollup referenced, but had the packages installed locally!

The reason you had a failed build was due to the npm script calling the old ionic build command and not the newnpm run ionic:build. I have updated package.json to fix this.

Anyway, I have updated all dependencies and upgraded the project to the latest Ionic and Angular releases and fixed the references to the missing NPM modules.

So please try again.

Thanks for the feedback.

Paul