angular2-localstorage icon indicating copy to clipboard operation
angular2-localstorage copied to clipboard

Angular 2 Final - has no exported member 'provide' or 'Type'

Open blubberbo opened this issue 7 years ago • 18 comments

I am running the Angular 2 Final release ^2.0.2 and angular2-localstorage is giving the following errors in the file "LocalStorageEmitter.ts":

"/node_modules/@angular/core/src/facade/lang" has no exported member 'Type' "/node_modules/@angular/core/src/di" has no exported member 'provide'

I just installed angular2-localstorage from npm, so I have latest.

Any experiencing the same issue?

Thanks

blubberbo avatar Oct 17 '16 15:10 blubberbo

+1

fivepapertigers avatar Oct 24 '16 15:10 fivepapertigers

Same error.

radarsu avatar Oct 25 '16 20:10 radarsu

I got same error

qvantor avatar Nov 02 '16 11:11 qvantor

I found the same error too.

daveksb avatar Nov 05 '16 05:11 daveksb

https://github.com/btroncone/ngrx-store-localstorage this is better

qvantor avatar Nov 05 '16 10:11 qvantor

I've gotten the same issue when following the basic instructions, is there any fix in sight for Angular 2 Final?

woutrbe avatar Dec 16 '16 08:12 woutrbe

You can try to use https://github.com/radarsu/angular2-localstorage. I fixed some minor issues there.

radarsu avatar Dec 19 '16 12:12 radarsu

Merged angular-2.0.0 fixes. Please try again with master version.

marcj avatar Feb 02 '17 13:02 marcj

Getting this now, when i started using it : I am using latest version for angular and other dependencies

ERROR in [default] c:\Repository\xyz\node_modules\angular2-localstorage\LocalStorageEmitter.ts:46:8 Module '"c:/Repository/xyz/node_modules/@angular/core/src/facade/lang"' has no exported member 'Type'.

ERROR in [default] c:\Repository\xyz\node_modules\angular2-localstorage\LocalStorageEmitter.ts:47:8 Module '"c:/Repository/xyz/node_modules/@angular/core/src/di"' has no exported member 'provide'.

ERROR in [default] c:\Repository\xyz\src\app\app.module.ts:3:54 Cannot find module 'angular2-localstorage'.

hsaklecha avatar Feb 02 '17 13:02 hsaklecha

Is this issue resolved, i am still getting error

hsaklecha avatar Feb 03 '17 06:02 hsaklecha

angular 2.4.6 x angular2-localstorage 0.4.0 => still occuring

mdopieralski avatar Feb 14 '17 12:02 mdopieralski

+1

jelling avatar Mar 10 '17 02:03 jelling

+1

SuTran avatar Mar 11 '17 09:03 SuTran

My fork of angular2-localstorage works pretty well with newest Angular2 version and has some extra features (with no breaking changes) listed in README. Hope you'll enjoy it :)

DanielKucal avatar Mar 14 '17 00:03 DanielKucal

@hsaklecha @mdopieralski @jelling @SuTran This is probably, because you are installing this library using npm, for whatever reason the github version and npm version seem out-of-sync.

venikx avatar Mar 14 '17 09:03 venikx

Replace this lines from "LocalStorageEmitter.ts" from node_modeule "angular2-localstorage"

import {Type} from "@angular/core/src/facade/lang";
import {provide} from "@angular/core/src/di";
import {ComponentRef} from "@angular/core";

export function LocalStorageSubscriber(appPromise: Promise<ComponentRef<any>>) {
    appPromise.then((bla) => {
        bla.injector.get(<Type>LocalStorageService);
    });
}

with this.

import {Type} from "@angular/core/src/type";
import {Provider} from "@angular/core/src/di";
import {ComponentRef} from "@angular/core";

export function LocalStorageSubscriber(appPromise: Promise<ComponentRef<any>>) {
    appPromise.then((bla) => {
        bla.injector.get(<Type<any>>LocalStorageService);
    });
}

It's Works for me...

chopada avatar Apr 06 '17 10:04 chopada

Thanks @chopada , it works for me.

fToledo29 avatar Jun 13 '17 19:06 fToledo29

Thanks @chopada , worked for me as well.

YannikHsKA avatar Aug 11 '17 12:08 YannikHsKA