Module no exported member for new pages in ionic2

#1

I have created a ionic2 porject and added a new page with the following command
ionic g page new
I have imported the new page in both app.component.ts and app.module.ts.
When I start the project with ionic serve is gives me the following error

[18:00:33]  typescript: E:/MyApp/Projects/Ionic/Test7/test/src/app/app.module.ts
, line: 8        L6:
import { NewPage } from '../pages/new/new';

            Module '"E:/MyApp/Projects/Ionic/Test7/test/src/pages/new/new"' has
no exported member 'NewPage'.

Any help regarding this issue?

Following is the version. All updates and reinstall tried.
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.36
OS: Windows 8.1
Node Version: v6.7.0

1 Like
#2

Same here, any clue?

#3

facing same issue… any idea?

Your system information:

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 2.6
Node Version: v7.4.0
Xcode version: Not installed

[13:48:26] ionic-app-scripts 1.0.0
[13:48:26] watch started …
[13:48:26] build dev started …
[13:48:26] clean started …
[13:48:26] clean finished in 10 ms
[13:48:26] copy started …
[13:48:26] transpile started …
[13:48:31] typescript: src/app/app.component.ts, line: 7
Module ‘"/home/ramasr/Desktop/Arun/ionicApp/IBMPortal/src/pages/login/login"’ has no exported member
’login’.

   L6:  import { Page2 } from '../pages/page2/page2';
   L7:  import { login } from '../pages/login/login';

[13:48:31] transpile failed

#4

export class *******

In your pages .ts file the above line has to be updated.

#5

Almost everyone following the official Ionic 2 blog tutorial might face the same issue but no helping hand from the Ionic 2 Team.

Tutorial link
http://blog.ionic.io/10-minutes-with-ionic-2-adding-pages-and-navigation/

Error thrown from the line
import {Page} from ‘ionic-angular’;

No exported member ‘Page’ from ionic-angular

1 Like
#6

You’re referencing something that’s a year old. The syntax has changed, and now you decorate with @Component.

#7

Any solution found ?

#8

What are you looking for a solution to? This thread is talking about ancient syntax that hasn’t been relevant for a long time.

#9

I am looking for a solution for the below error :

My Ionic information:

Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: OS X El Capitan
Node Version: v7.8.0
Xcode version: Not installed

After i generate a new page.

$ionic g page messages

I get the below error after ionic serve:

Typescript Error
Property ‘forChild’ does not exist on type ‘typeof IonicModule’.

src/pages/messages/messages.module.ts
imports: [
IonicModule.forChild(Messages),
],

How can i resolve the error ?

#10

If you want to use lazy page loading, change that IonicModule to IonicPageModule. If you don’t, blow away that messages.module.ts file than was generated.

#11

Open page.module.ts file and look at " import { xxx } from ‘./page’;"

in your case xxx might be not same in
app.module.ts and
app.component.ts