Skip to content

ionic2 RC.0, Interface does not export #8632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
masatada opened this issue Oct 11, 2016 · 2 comments
Closed

ionic2 RC.0, Interface does not export #8632

masatada opened this issue Oct 11, 2016 · 2 comments

Comments

@masatada
Copy link

1.Make interface .ts file. (./src/app/test.ts)

export interface Test {
  id: number;
}

2.Import interface on app.component.ts.

import { Component, Input } from '@angular/core';

import { Platform } from 'ionic-angular';
import { StatusBar } from 'ionic-native';

import { TabsPage } from '../pages/tabs/tabs';
import { Test } from './test';

@Component({
  template: `<ion-nav [root]="rootPage"></ion-nav>`
})
export class MyApp {

  // interface call 
  @Input() test: Test;

  rootPage = TabsPage;

  constructor(platform: Platform) {
    platform.ready().then(() => {
      StatusBar.styleDefault();
    });
  }
}

3.run ionic serve, it gives me an error:

[18:39:34]  bundle dev failed:  Module /Users/test/Documents/develop/unk/src/app/test.ts does not export Test (imported by /Users/test/Documents/develop/unk/src/app/app.component.ts)

[18:39:34]  Error: Module /Users/test/Documents/develop/unk/src/app/test.ts does not export Test (imported by /Users/test/Documents/develop/unk/src/app/app.component.ts)
    at Module.trace (/Users/test/Documents/develop/unk/node_modules/rollup/dist/rollup.js:7706:29)
    at ModuleScope.findDeclaration (/Users/test/Documents/develop/unk/node_modules/rollup/dist/rollup.js:7329:22)
    at Scope.findDeclaration (/Users/test/Documents/develop/unk/node_modules/rollup/dist/rollup.js:5349:39)
    at Identifier.bind (/Users/test/Documents/develop/unk/node_modules/rollup/dist/rollup.js:6497:29)
    at /Users/test/Documents/develop/unk/node_modules/rollup/dist/rollup.js:5149:50
    at UnaryExpression.eachChild (/Users/test/Documents/develop/unk/node_modules/rollup/dist/rollup.js:5166:5)
    at UnaryExpression.bind (/Users/test/Documents/develop/unk/node_modules/rollup/dist/rollup.js:5149:7)
    at UnaryExpression.bind (/Users/test/Documents/develop/unk/node_modules/rollup/dist/rollup.js:6893:53)
    at /Users/test/Documents/develop/unk/node_modules/rollup/dist/rollup.js:5149:50
    at BinaryExpression.eachChild (/Users/test/Documents/develop/unk/node_modules/rollup/dist/rollup.js:5166:5)

The problem same probably:
https://forum.ionicframework.com/t/interface-does-not-export-bundle-dev-failed/66225

@Manduro
Copy link
Contributor

Manduro commented Oct 11, 2016

This is probably the same problem as this one: ionic-team/ionic-app-scripts#105. Interesting to see you traced it to the @Input typing!

@jgw96
Copy link
Contributor

jgw96 commented Oct 11, 2016

Hello all! Thanks for opening an issue with us! I am going to go ahead and close this as a duplicate to the issue @Manduro linked to in the above comment as it does seem to be the same issue, or at least caused by the same root issue.

@jgw96 jgw96 closed this as completed Oct 11, 2016
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018
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