Skip to content

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

@myuniverse8

Description

@myuniverse8

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

  1. Build and run this project in ssr mode.

The error will be in terminal:
image

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

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

Previously it has a verification that prevented this issue:
image

But it was changed in this commit jprichardson/node-fs-extra@f4a880d:

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions