Runtime Error - Cannot Find Module "."


#1

Not sure what I did wrong, but i’ve apparently made a change that causes this error to show when running on “ionic serve”. I’ve tried backtracking, but I still haven’t been able to find this issue. Anyone have any ideas of what could possibly be the issue?

ionic info:

global packages:

@ionic/cli-utils : 1.3.0
Cordova CLI      : 6.4.0
Ionic CLI        : 3.3.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.3.0
@ionic/cli-plugin-ionic-angular : 1.3.0
Cordova Platforms               : ios 4.3.1
Ionic Framework                 : ionic-angular 3.2.1

System:

Node       : v7.0.0
OS         : macOS Sierra
Xcode      : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.0
ios-sim    : 5.0.13

Can’t post code… as there’s a lot of it. But i’m sure the issue is something really small


#2

Does the error give the Module it cant find? What type is it? Was it included in the app.module.ts file?


#3

Nope it’s quite vague I feel.

Here’s a screenshot of the specific error:


#4

Check all your imports for something looking like import {Foo} from '.', and in the future post text as text, not screenshots.


#5

Fixed it, seems auto import on visual code imported the wrong module.

It imported:

import { ToastController } from 'ionic-angular/umd';

instead of

import { ToastController } from 'ionic-angular';

#6

It works to me too but I’d to change in all .ts files in my project where had an import from ‘ionic-angular/umd’; to import from ‘ionic-angular’;


#7

It works, thank you.


#8

Yeah! I had the same error with vscode. Thanks :+1:


#9

Where is this command? import { ToastController } from ‘ionic-angular/umd’;
I couldn’t find it.