← All tasks
javascriptlog4js-node/log4js-node #1225Not a task: already works

TypeError: Cannot read property 'name' of undefined using log4js (^6.4.0) with angular in ssr mode

envgap__log4js-node__log4js-node-1225

01 / FAILURE SIGNATURE

As reported upstream

The error will be in terminal:
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
cfb0c48183ea2c13929d3e281b1846aa736d3a36
Manifest
package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

log4js-node/log4js-node #1225 · read the original issue
Hello,



I am facing one issue in chain of packages: "log4js" -> "streamroller" -> "fs-extra" -> "graceful-fs" and "universalify" 



This is the way how it could be reproduced:

1. Create a new angular project

2. Implement ssr (https://angular.io/guide/universal)

3. Install "log4js" and use it to log something in server.ts file for example:



![image](https://user-images.githubusercontent.com/26976841/161244695-38425ba5-9cda-484d-8e1e-c9889d073a03.png)



5. Build and run this project in ssr mode.



The error will be in terminal:

![image](https://user-images.githubusercontent.com/26976841/161244856-1919a658-0aed-476b-8048-f5ae463ac2eb.png)



After some investigations I have found that in last versions of "log4js" the version of "streamroller" was changed from "2.x.x" to "3.x.x" which caused changing the version of "fs-extra" to the last one.



The issue occurs in "universalify" package which is used by "fs-extra":

![image](https://user-images.githubusercontent.com/26976841/161245477-9307fabf-4e57-4364-9b40-a0bdb7c51738.png)



If we go step up in the callstack then we see this part of code in "fs-extra":

![image](https://user-images.githubusercontent.com/26976841/161245651-ef58cbd9-8f80-4a5b-bd05-36ac878f9c3f.png)



Previously it has a verification that prevented this issue:

![image](https://user-images.githubusercontent.com/26976841/161245749-df8fd336-8b7f-40ed-88f4-7e00c29a3f12.png)



But it was changed in this commit https://github.com/jprichardson/node-fs-extra/commit/f4a880d29c3a699c0695755fe8533d786c55f65f: 



In this case maybe "graceful-fs" should be updated in order to return proper value in this case, because it doesn't return proper value for fs.realpath.native:

![image](https://user-images.githubusercontent.com/26976841/161246376-85ceb6d7-e95d-47f5-9d56-853aa352be94.png)



With "log4js" version 6.3.0 there is no such issue because it uses the old version of "streamroller" which uses the old version of "fs-extra" which has versification mentioned above.



I am not sure on which package I should report this issue but I see it because I am using "log4js" so maybe this is the right place to start. 

 

Could you please check it? 



Thank you very much for your help in advance.



Best Regards,

Andrei

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]