Saturday, 30 June 2018

Angular Universal Starter Cannot find module

I am using Angular Universal Starter and I am very new to it. I inherited an existing project so I am trying to run it on my local machine. When I first try to run the project I get this error:
ERROR in src/app/auth/authentication.service.ts(5,26): error TS2307: Cannot find module '../../app/globals'.
src/pages/register/register.component.ts(2,26): error TS2307: Cannot find module '../../app/globals'.

Okay, so I created a file called globals.ts:
export class GlobalsModule {}

And so I run my project again and I get this error:
src/shared/user/profile-tabs/profile-tabs.component.ts(53,19): error TS2339: Property
 'baseUrl' does not exist on type 'typeof "/Users/jsuske/Downloads/paindown_front/src/app/globals"'.
src/shared/user/profile-tabs/profile-tabs.component.ts(61,21): error TS2339: Property
 'storageUrl' does not exist on type 'typeof "/Users/jsuske/Downloads/paindown_front/src/app/globals"'.
src/shared/user/profile-tabs/profile-tabs.component.ts(70,29): error TS2339: Property 
'imageUserDefault' does not exist on type 'typeof "/Users/jsuske/Downloads/paindown_front/src/app/globals"'.

So it appears this file is now missing 3 Properties.
My question is how do I define there 3 Properties (baseUrl, storageUrl and imageUserDefault) and possibly populate them?
Here is a little more information, the globals is imported into a component like so:
import * as globals from '../../app/globals';

and Property is called like so:
source = globals.baseUrl

PLEASE HELP!


from Angular Universal Starter Cannot find module

No comments:

Post a Comment