Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logger middleware: constant value cannot be serialized #391

Closed
andreasrueedlinger opened this issue Oct 14, 2016 · 2 comments
Closed

Logger middleware: constant value cannot be serialized #391

andreasrueedlinger opened this issue Oct 14, 2016 · 2 comments

Comments

@andreasrueedlinger
Copy link

Expected Behavior

Using a constant value binding should not break the logger middleware and output a corrsponding serialization.

Current Behavior

It fails with the error Cannot read property 'name' of null for `implementationDetail

Possible Solution

Not only check for undefined but also for null values

Steps to Reproduce (for bugs)

User logger middleware, bind a constant value eg. kernel.bind<string>('string').toConstantValue('foo') and use it in a inject.

Stack trace

***/node_modules/inversify-logger-
middleware/lib/serializers/text/binding_serializer.js:26                    
                    val = _b[prop].name;                                    
                                  ^                                         

TypeError: Cannot read property 'name' of null                              
    at ***/node_modules/inversify-
logger-middleware/lib/serializers/text/binding_serializer.js:26:35          
    at Array.forEach (native)                                               
    at Object.serializeBinding [as default]
@remojansen
Copy link
Member

Thanks for reporting this issue. We will fix it ASAP feel free to send a PR if you want to contribute a fix (Please remember to add a test case to reproduce the issue before fixing).

@remojansen
Copy link
Member

Done by inversify/inversify-logger-middleware#32 & released by with [email protected] 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants