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
Incompatible versions of fs-extra specified for streamroller and log4js #170
Comments
The error (cannot read property I'm sceptical because the affected version is not in use here:
Furthermore, all So, I need more information from you to replicate and fix the issue.
|
Or did you check if any other dependencies you have might have that pulled in |
Makes sense but failing in my repo with
Hence my question: should streamroller be using the same major version of
Thought I posted in the issue, but I am using log4js version 6.9.1 with node.js 18.18.2. I can try to reproduce but probably won't have time. This is in a client project. The error in the project has the same stacktrace as log4js-node/log4js-node#1225. Personally, I don't like the npm cli for projects to eliminate potential issues with transitive dependencies but I have no choice. My workaround right now is to force resolve fs-extra to 9.x or 11.x. |
Checked again and only see 9.1.0 and 8.1.0 installed. Doesn't make sense to me either tbh |
Apparently, you didn't 😓. But it's all good now.
Nope. Lines 44 to 51 in 8098400
As you mentioned, you only have Do you know which dependency pulled in |
Perhaps to help narrow down the cause, can you do the following to your First, log out all the functions before you do any require/import. Code logic can be after all these; it won't need to get there to trigger the error. console.log("=====1=====");
console.log("NODEJS VERSION:", process.version);
console.log("2nd-level API fs.appendFile:", fs.appendFile); // an arbitrary second-level API (fs.xxx)
console.log("2nd-level API fs.realpath:", fs.realpath);
console.log("3rd-level API fs.realpath.native:", fs.realpath.native); // a third-level API (fs.xxx.yyy)
// your existing require/import here (code logic not required)
console.log("=====2=====");
console.log("2nd-level API fs.appendFile:", fs.appendFile); // an arbitrary second-level API (fs.xxx)
console.log("2nd-level API fs.realpath:", fs.realpath);
console.log("3rd-level API fs.realpath.native:", fs.realpath.native); // a third-level API (fs.xxx.yyy)
console.log("=====3=====");
var streamroller = require("streamroller"); // you should get the error stacktrace here
console.log("=====4====="); // if no error stacktrace, proceed
console.log("2nd-level API fs.appendFile:", fs.appendFile); // an arbitrary second-level API (fs.xxx)
console.log("2nd-level API fs.realpath:", fs.realpath);
console.log("3rd-level API fs.realpath.native:", fs.realpath.native); // a third-level API (fs.xxx.yyy)
// your existing code logic |
|
Ok, didn't really say that. I was merely suggesting aligning the major version of fs-extra across streamroller and log4js Causes issues in my project's test suite because of the version difference. The application works fine but its jest test suite breaks. Don't know why as you stated before my project is not using nor installing fs-extra 10.x. I was merely suggesting aligning both streamroller and log4js to 11.x to prevent the issue that I mentioned. |
I can attach the debugger when I have a chance. Might not be for 2 weeks though. |
Why? node.js 8.x has been end of life since January 1, 2020. |
I see 9.x is a devDependency in jest-openapi as well. Not sure why the error is when log4js is Initially, I thought the stacktrace in the project was wrong in CI but reproduced on local dev machine. Let me dig some more. |
Technically,
Thanks for providing
Can you provide the
Because it would have to be a major semver change for |
Sure dependencies: {
"dependencies" : {
"@aws-sdk/client-athena": "^3.0.0",
"@aws-sdk/client-lambda": "^3.0.0",
"@aws-sdk/client-s3": "^3.0.0",
"@aws-sdk/client-secrets-manager": "^3.0.0",
"@aws-sdk/client-ssm": "^3.0.0",
"@okta/jwt-verifier": "^3.0.0",
"@vendia/serverless-express": "^4.0.0",
"cookie-parser": "^1.0.0",
"cors": "^2.0.0",
"express": "^4.0.0",
"http-errors": "^2.0.0",
"log4js": "^6.0.0",
"swagger-autogen": "^2.0.0",
"yaml": "^2.0.0"
}
} {
"devDependencies": {
"@aws-sdk/util-stream-node": "^3.0.0",
"aws-sdk-client-mock": "^3.0.0",
"aws-sdk-client-mock-jest": "^3.0.0",
"chai": "^4.0.0",
"env-cmd": "^10.0.0",
"jest": "^29.5.0",
"jest-openapi": "~0.14.2",
"nodemon": "^3.0.0",
"supertest": "^6.0.0"
}
} Need to log off for the night. Might have missed some packages in dependencies though. Will update tomorrow if I have a chance. |
Hmm, I created a I required/imported both the dependencies and devDependencies in the |
Circling back. I updated the dependencies in my original comment with some missing dependencies. Frustrating that I can't copy and paste the dependencies from the project. Also, frustrating that it seems like you don't believe me. I will have to look at the zip file when I have a chance. It happens during |
I have updated the It is equally frustrating not to be able to replicate the issue. |
Trying this out. Unfortunately, no longer have access to the code but let me see what happens locally with the project you attached. |
No idea. Might have missed a package. Attached a Closing. Apologies for the waste of time. Very strange issue. |
I am running into incompatible package versions of
fs-extra
across 3 packages. log4js, streamroller, and jest-openapi.The same error (cannot read property
name
ofundefined
) in log4js issue 1225 occurs when running jest tests.I see streamroller is still using fs-extra 8.x where log4js is using fs-extra 11.x.
jest-openapi is using fs-extra 9.x.
Currently, I specified an override in the package.json file to force fs-extra 9.x to be used for all packages which appears to be a short-term fix.
Should streamroller's fs-extra package be updated to align with log4js?
I believe aligning them would fix log4js-node/log4js-node#1225
The text was updated successfully, but these errors were encountered: