Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Removing unused Module/Code breaks the app without error #893

Closed
mburger81 opened this issue Apr 12, 2017 · 4 comments
Closed

Removing unused Module/Code breaks the app without error #893

mburger81 opened this issue Apr 12, 2017 · 4 comments

Comments

@mburger81
Copy link
Contributor

Short description of the problem:

Removing an unused Module which has only a simple service as provider breaks our app. The app does not run but also gives absolute no error. I tried "ionic serve" ionic cordova:run/build android" and others. On any system we have the same problem.

I think this should be an ionic-app-script problem or is it an ionic-angular problem?

The BUG is very very very strange!!!! This is my simple Module and my simple service where I have remove any of the code expect the code where are errors.

import { NgModule } from '@angular/core';
import { LATouchService } from './la-touch.service';

@NgModule({
    providers: [ LATouchService ]
})
export class LATouchModule { }

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Rx';

@Injectable()
export class LATouchService {

    public touchstart(touchEvent: TouchEvent, htmlElement: HTMLElement) {
        if (1 === 1) {
        } else {
            Observable
                .interval(300)
                .take(1)
                .subscribe(() => {
                    console.log('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
                });
        }
    }
}

The strange thing is, If I remove the Observable from the code which is also in this case (for test) an never reached code, I can run and server app, but the app doesn't load and give no error on it in console or somewhere else.
As I can not remove this line of code, I can not delete the service/module, I get the same error.

So I have to keep this complete empty module and service to get work the app ❓

Which @ionic/app-scripts version are you using?
I tested this with 1.3.1 and also with latest nightly 1.3.1-201704112210

Cordova CLI: 6.5.0 
Ionic Framework Version: 3.0.1
Ionic CLI Version: 3.0.0-beta.5
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.8
Node Version: v6.10.2
Xcode version: Not installed
@danbucholtz
Copy link
Contributor

Can you provide a sample repository and steps to recreate the issue?

Thanks,
Dan

@abomadi
Copy link
Contributor

abomadi commented Apr 17, 2017

check #871

@mburger81
Copy link
Contributor Author

@danbucholtz i check to reproduce this issue on a new project which I can share with you, but it is not possibile to reproduce the error. In my personal opinion I think there would be some cached file which makes some problems or something else.

But if you can merge @abomadi #871 PR probably we can find out the error on this, or @abomadi can you share a merged build for me to test it?

@danbucholtz
Copy link
Contributor

We'll revisit if you can provide a repro case.

Thanks,
Dan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants