Errors trying to 'serve' in RC.0

I’m trying to update an existent project to ionic to 2.0.0-rc.0 so I followed step by step the changelog (https://github.com/driftyco/ionic/blob/master/CHANGELOG.md#steps-to-upgrade-to-rc0), however I’m still facing some issues.

I just started a new sidemenu project, then I replaced the pages/imports with my files accordingly.

So the first issue is that I’m getting this annyoing error everytime:

build dev failed:  Build failed: ENOENT: no such file or directory, scandir 'my-folder-app/.tmp/pages/about'

[23:44:14]  Error: ENOENT: no such file or directory, scandir 'my-folder-app/.tmp/pages/about'

The second thing is:

I installed ‘moment’ lib as the following: npm install @types/moment --save-dev --save-exact and imported it as related in docs:

import moment from 'moment';
import 'moment/locale/pt-br';

But I’m still getting the following error

Error: Cannot call a namespace ('moment')

PS: I followed this template provided in one of the issues on github: https://github.com/driftyco/ionic-third-party-lib-example/blob/master/src/pages/home/home.ts. Also, as in template, created a new file called declarations.d.ts and defined:

/*
	declare module 'lodash';
	declare module 'moment';
*/

Your system information:

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS
Node Version: v6.3.1

Any help would be appreciated.
Thanks.

2 Likes

Your second issue is likely caused by a wildcard import. Don’t import * from "moment", import moment from "moment".

1 Like

I’m using the same way with lodash(import lodash from 'lodash';) and it’s working…

See here

1 Like