Skip to content

ionic2 RC.0, Interface does not export #8632

Closed
@masatada

Description

@masatada

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions