Module no exported member for new pages in ionic2

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

Same here, any clue?

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

export class *******

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

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

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

Any solution found ?

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

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 ?

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.

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