ERROR in [default] \node_modules\angular2-logger\app\core\logger.ts:62:38 Type 'string' is not assignable to type 'Level'.
See original GitHub issueIssue Description
This problem appeared with angular2-logger 0.3.0 after I updated to Angular 2 rc5. I just updated angular2-logger to its latest 0.4.2 and the problem still shows up.
ERROR in [default] \node_modules\angular2-logger\app\core\logger.ts:62:38 Type 'string' is not assignable to type 'Level'.
Changing the line from:
private _loadLevel = (): Level => localStorage.getItem( this._storeAs );
to
private _loadLevel = (): any=> localStorage.getItem( this._storeAs );
seems to resolve the problem.
Issue Analytics
- State:
- Created 7 years ago
- Comments:39 (16 by maintainers)
Top Results From Across the Web
Typescript Type 'string' is not assignable to type - Stack Overflow
I mean something like this let myFruit:Fruit = "Apple" let something:string = myFruit as string It is giving me error: Conversion of type...
Read more >Type error: Type 'TFunctionResult' is not assignable to type ...
Type error : Type 'TFunctionResult' is not assignable to type 'ReactNode' This typescript error is not fixed by using withTranslation HOC.
Read more >15 Typescript Mistakes To Avoid - SoftwareMill Tech Blog
Type 'undefined' is not assignable to type 'string' . Not checking the bind, call and apply types. Another one is --strictBindCallApply .
Read more >Documentation - Narrowing - TypeScript
Type 'string' is not assignable to type 'number'. } Try. Uh-oh, we're getting an error on padding . TypeScript is warning us that...
Read more >Type 'string' is not assignable to type 'ReadPreference'.
Details ; Type: Bug ; Status: Closed ; Priority: Unknown ; Resolution: Fixed ; Affects Version/s: None.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ha, edited the best part 😃 Most heated “search for truth” I’ve witnessed so far! Thanks guys!
Yea @ascreamingweas ,
In short, it means your build process is compiling this third party library which is an overhead in your build process since the library is already compiled, the fact that you get this error means your build process can be highly improved in order to avoid already compiled third parties (not only this one, but any), getting compiled once again by your PC. If you follow the Quickstart Guide in Angular 2 for either SystemJS or Webpack you won’t get this error.
If you don’t care about this extra overhead in your project’s build process you can leave it as is, I’ll be commiting a fix for this error soon enough.