question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR in [default] \node_modules\angular2-logger\app\core\logger.ts:62:38 Type 'string' is not assignable to type 'Level'.

See original GitHub issue

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:closed
  • Created 7 years ago
  • Comments:39 (16 by maintainers)

github_iconTop GitHub Comments

3reactions
vkniazeucommented, Sep 12, 2016

Ha, edited the best part 😃 Most heated “search for truth” I’ve witnessed so far! Thanks guys!

1reaction
langley-agmcommented, Sep 19, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found