Ionic 2 RC1: Unexpected character @ using Ionic Serve


#1

On a new blank starter project I am getting this error when using Ionic Serve. However when using “ionic run browser” everything loads correctly with no error. I started this blank project because have the same issue with the real project I am working on. I was thinking it was it might be something to do with Ionic and NPM so I uninstalled Ionic and reinstalled but same results.

Uncaught Error: Module parse failed: \projects\ionic-rc1\node_modules@ionic\app-scripts\dist\loaders\ionic-loader.js! projects\ionic-rc1\src\pages\home\home.ts Unexpected character @ (5:0)

You may need an appropriate loader to handle this file type.
| import { NavController } from ‘ionic-angular’;

Here is my Ionic Info…

Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.37
OS:
Node Version: v6.2.2

Anyone else experience this? :cold_sweat:


#2

Had a similar issue… not exactly with the blank starter project, but with the migration of my project from ionic beta 11 to rc0. The problem was on the path of the import of one of my providers of app.module.ts.

Changed
import { ListService } from “…/tmp/pages/dashboard/children-list.service”;
to
import { ListService } from "../pages/dashboard/children-list.service";


#3

Probably got a wrong import
executed this on project folder:

grep -r \\.ts src/

Verify that you have the good import.