Skip to content

Uncaught TypeError: Cannot read properties of undefined (reading 'native') #1372

@MUmeshKumar

Description

@MUmeshKumar

Hi,

When i try to import log4js in my app.js i'm getting following error -

Uncaught TypeError: Cannot read properties of undefined (reading 'native')
at ./node_modules/log4js/node_modules/fs-extra/lib/fs/index.js (index.js:107:1)
at webpack_require (bootstrap:856:1)
at fn (bootstrap:150:1)
at ./node_modules/log4js/node_modules/fs-extra/lib/index.js (index.js:6:1)
at webpack_require (bootstrap:856:1)
at fn (bootstrap:150:1)
at Object. (RollingFileWriteStream.js:2:1)
at ./node_modules/log4js/node_modules/streamroller/lib/RollingFileWriteStream.js (RollingFileWriteStream.js:338:1)
at webpack_require (bootstrap:856:1)
at fn (bootstrap:150:1)
at ./node_modules/log4js/node_modules/streamroller/lib/index.js (index.js:2:1)
at webpack_require (bootstrap:856:1)
at fn (bootstrap:150:1)
at Object. (file.js:3:1)
at ./node_modules/log4js/lib/appenders/file.js (file.js:154:1)
at webpack_require (bootstrap:856:1)
at fn (bootstrap:150:1)
at Object. (index.js:17:1)
at ./node_modules/log4js/lib/appenders/index.js (index.js:182:1)
at webpack_require (bootstrap:856:1)
at fn (bootstrap:150:1)
at ./node_modules/log4js/lib/log4js.js (log4js.js:27:1)
at webpack_require (bootstrap:856:1)
at fn (bootstrap:150:1)
at Module. (appenders sync:9:1)
at ./src/App.js (App.js:332:1)

My setup configuration -
React - 17.0.2
Node - v16.19.0
npm - 8.19.3
log4js - 6.8.0

I see version of fs-extra mentioned in the log4js/package.json is ^11.1.0 but in the log4js/node_modules/fs-extra/package.json says 8.1.0
image

Even after modifying the fs-extra module with the latest version 11.1.0, still error persists.

I also have seen similar error in Angular(#1225) followed the steps you mentioned. still facing same problem.
Can you please let me know what could be the possible reason for this error?

Thanks for your help in advance!

Best regards,
-Umesh

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions