Module '"F:/Ionic2/Project/src/pages/login/login"' has no exported member 'login'

can anyone help me on this issue. I tried with ionic beta version and also I used ionic 2.1.1 still facing same issue. Tried in different OS linux and also windows using npm.

Getting the error while trying to create a new page and added the page “login” to the app.module.ts

import { NgModule, ErrorHandler } from ‘@angular/core’;
import { IonicApp, IonicModule, IonicErrorHandler } from ‘ionic-angular’;
import { MyApp } from ‘./app.component’;
import { Page1 } from ‘…/pages/page1/page1’;
import { Page2 } from ‘…/pages/page2/page2’;
import { login } from ‘…/pages/login/login’;

and getting below error while serving.

[23:51:12] build finished in 4.63 s

[23:51:15] build started …
[23:51:15] transpile update started …
[23:51:15] transpile update finished in 11 ms
[23:51:15] webpack update started …
[23:51:15] build started …
[23:51:16] transpile update started …
[23:51:16] transpile update finished in 6 ms
[23:51:16] webpack update started …
[23:51:18] webpack update finished in 2.45 s
[23:51:19] typescript: F:/Ionic2/ISPortal/src/app/app.module.ts, line: 6
Module ‘“F:/Ionic2/ISPortal/src/pages/login/login”’ has no exported member ‘login’.

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

[23:51:19] build finished in 4.51 s

[23:51:19] build finished in 4.34 s

[23:51:22] typescript: F:/Ionic2/ISPortal/src/app/app.module.ts, line: 6
Module ‘“F:/Ionic2/ISPortal/src/pages/login/login”’ has no exported member ‘login’.

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

Ionic info:

ordova 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: Windows 8.1
Node Version: v6.9.4
Xcode version: Not installed

Thanks in advance.

Whats the class name for login.ts?

You should have something like

export class LoginPage{}
1 Like

Thanks for your reply.
I m a newbie to ionic.
It fixed the issue after changing the import name to “LoginPage”.