Closed bencameron00 closed 6 years ago
The latest version: 3.1.2 should fix this. Let me know if it fixed for u :)
Hi Hacklone. I am using 3.1.2 and still see the error. Here is a copy of my dependencies...
"dependencies": {
"@angular/animations": "5.0.0",
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/compiler-cli": "5.0.0",
"@angular/core": "5.0.0",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@angular/platform-server": "5.0.0",
"@angular/router": "5.0.0",
"angular2-cool-storage": "3.1.2",
"angular2-highcharts": "^0.5.5",
"bootstrap": "^3.3.6",
"dragula": "^3.7.2",
"file-saver": "^1.3.3",
"font-awesome": "^4.7.0",
"jquery": "^3.2.0",
"lodash": "^4.17.4",
"moment": "^2.19.1",
"ng2-dragula": "^1.5.0",
"ng2-page-scroll": "^4.0.0-beta.9",
"ng2-sticky-kit": "4.1.3",
"ngx-bootstrap": "^1.9.1",
"primeng": "^4.2.2",
"rxjs": "^5.5.0",
"signalr": "^2.2.2",
"wijmo": "./NpmImages/wijmo-amd-min",
"zone.js": "^0.8.18"
},
Did I need to make any code changes when upgrading to 3.1.2?
Hmm, no 3.1.2 should work fine with angular 5... Can you debug which parameter angular is missing? (Can’t resolve all parameters for CoolLocalStorage)
Would it be something to do with how I'm setting up the module?
In my app.module.ts I'm doing this...
import { CoolLocalStorage } from 'angular2-cool-storage';
// services
providers: [appRoutingProviders,
...
CoolLocalStorage
]
})
Then in my component...
import { CoolLocalStorage } from 'angular2-cool-storage';
constructor(... private localStorage: CoolLocalStorage, ...) { }
Does that look correct to you? It used to work like this.
Thanks Ben
Hi, All
I also have the error on angular 5 with angular2-cool-storage 3.1.2
Unexpected value 'CoolStorageModule' imported by the module 'AppModule'. Please add a @NgModule annotation.
at syntaxError (compiler.js:466)
at compiler.js:15088
at Array.forEach (<anonymous>)
at CompileMetadataResolver.webpackJsonp.../../../compiler/esm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata (compiler.js:15071)
at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._loadModules (compiler.js:33484)
at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._compileModuleAndComponents (compiler.js:33445)
at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler.compileModuleAsync (compiler.js:33361)
at CompilerImpl.webpackJsonp.../../../platform-browser-dynamic/esm5/platform-browser-dynamic.js.CompilerImpl.compileModuleAsync (platform-browser-dynamic.js:230)
at PlatformRef.webpackJsonp.../../../core/esm5/core.js.PlatformRef.bootstrapModule (core.js:5443)
at Object.../../../../../src/main.ts (main.ts:11)
Do you find the solution?
I'm having the same issue as @anvial, any suggestions?
apparently we need something like this: @NgModule({ .... }) export class CoolStorageModule{ } But in what file? index.d.ts? Hopefully Hacklone provides an updated version.
any solution please , bumped into the same problem
@nelsonBlack Sorry to say I haven't worked out the solution yet. @Hacklone : any suggestions, please?
@petterhoel i got a work around to use while waiting for the fix by downgrading to coolstorage version 3.1.0 , delete the version of coolstorage you have -->npm uninstall angular2-cool-storage then in package.json dependencies add --->"angular2-cool-storage": "3.1.0", then npm install
I reverted the typescript version to 2.4.2 in the latest version: 3.1.3. Did that fix the problem for you?
@Hacklone Works on my machine 👍 :) Thanks!!!
After upgrading to Ng5 my application throws an error when loading in the browser.
My setup worked fine on the 4.x version of Angular.
The error text is...