-
Notifications
You must be signed in to change notification settings - Fork 972
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
[Node.js v20] Plugin Verification Meta Issue #9459
Comments
const fs = require('fs');
// Using encoding as a string
const data1 = fs.readFileSync('example.txt', 'utf8');
// Using encoding within an options object
const data2 = fs.readFileSync('example.txt', { encoding: 'utf8' });
// Verify the brotli variant matches
expect(
Zlib.brotliDecompressSync(
Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, `${filePath}.br`))
).toString('utf8')
).toEqual(raw);
// Verify the gzip variant matches
expect(
Zlib.gunzipSync(Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, `${filePath}.gz`))).toString('utf8')
).toEqual(raw);
Node 20 now stricter about comparing types. Even in tests, in earlier versions or configurations, there might been implicit conversion or looser type checking but now we must explicitly convert one type to the other #NOTES resize‐observer‐polyfill 1.5.1. However, with TypeScript 4.6+ (and especially in environments where DOM types are included by default, as is the case with Node.js 20 setups), the polyfill’s own type definitions conflict with the built‐in ResizeObserver types. new syntax in @types/lodash (v4.17.16) is causing errors even with newer TypeScript versions, the workaround is to downgrade both:
if we bump opensaearch js // After This combination has been shown to avoid the TS1005 errors in similar environments. we also need to map th apis that we are using from the client const gzipCompressedData = Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, hapi upgrade is going to be hard we should consider removing In Node.js 20, error codes now include the UV prefix (like UV_EACCES instead of just EACCES) This is a common issue when upgrading Node.js versions - the tests are often checking for exact error message strings that change between versions. Update the test expectations: Change the tests to expect the new error message format. This is the "correct" solution but requires more work. |
Background
To maintain optimal performance and security:
OpenSearch Dashboards is upgrading from Node.js
v18
tov20
With plans to deprecate explicit support for older versions of Node.js. The current version OpenSearch Dashboards will soon EOL so therefore we must upgrade.
Node.js Version End-of-Life Dates
Recent plugin build and installation tests on the
feature/node-2x
branch have ✅PASSED✅.OpenSearch Dashboards starts without issue under Node.js v20. However, plugin owners should verify their own plugins to ensure compatibility as soon as possible.
Timeline
We plan to merge this upgrade by the first week of March 2025. If no critical issues are reported by then, we will proceed with the upgrade. Please test and report any issues before this deadline.
Action Items
Recommended steps for plugin testing:
Potential Issues
Node.js 20 Upgrade Issues and Solutions
Action Items
we can continue adding temporary solutions, but we might want to discuss a more sustainable approach before our technical debt becomes unmanageable.
Verification Checklist
Following the manifest order:
Thank you for your support and collaboration!
The text was updated successfully, but these errors were encountered: