Ionic 2 Error: Cannot find module "../"

I’ve just upgraded my app to the latest release from a beta.11. It is been a while that I’ve used ionic so apologies if I’ve missed the obvious. I’ve done the following steps (copying everything in a new app) but getting an error when serving the app via ionic serve.

The this error I am getting is

main.js:17121 Uncaught Error: Cannot find module "../" 

which gets thrown by

throw new Error("Cannot find module \"../\"");

in main.js. It’s obvious that it can’t load a module, but it would be nice to know which module it can’t load. I have no clue, some help would be appreciated :slight_smile:

1 Like

are you using barrells (index.ts) files somewhere?

so somewhere you make thing like this:

import { xxx } from '../';

try using

import { xxx } from '../index';
1 Like

Yeah was stupid once again. After carefully looking in all my pages I found the culprit. Thanks for the help!

I have the same problem , but i’m not using index.ts

did you searched for ‘…/’ in your .ts files?

1 Like

i tried , still gives me this error
uncaught Error: Cannot find module “…/pages/add/add”(…)

I use without “pages” folder.
Try it

3 Likes


I have a error can someone help me please

Try this:
import { AboutPage } from ‘…/about/about’;

thanks for your reply mmaffet, my problem is resolved when i update the node js the lastest version.

can someone help me i I didn’t understand this error please, i can’t open a new page html

Is this issue is solved? I had the same issue when importing my service provider this time.