Repository navigation
TypeError: Cannot read properties of undefined (reading '0') using client.openSession(); #264
Description
Activity
Hi @scott16lloyd! Which Node version you use? Seems that your error is caused by this change to Node's
utilsmodule: nodejs/node#52147 Also, it would help if you share your devloop setup. If you're using Webpack, it may polyfill some native Nodejs APIs and sometimes break thingsAlso, seems somebody already stumbled at similar error, but the code wasn't properly fixed: nodejs/node#53089
Thank you for your reply @kravets-levko , I was running LTS version 20.16.0 so I tried 21.7.3 where I got:
Error: Module did not self-register: '/home/slloyd/database_ai_assistant/node_modules/lz4/build/Release/xxhash.node'. and node:419153) [DEP0040] DeprecationWarning: Thepunycodemodule is deprecated. Please use a userland alternative instead.so I tried the current version 22.6.0 which did run my code but there is 2 deprecation warnings:
(node:420067) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (node:420067) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods insteadpunycode warning seems to be an issue with eslint:
npm ls punycodeproject_name@0.1.0 /home/slloyd/project_name └─┬ eslint@8.57.0 └─┬ ajv@6.12.6 └─┬ uri-js@4.4.1 └── punycode@2.3.1and the Buffer() issue seems to link to lz4:
npm ls buffer project_name@0.1.0 /home/slloyd/project_name └─┬ lz4@0.6.5 └── buffer@5.7.I assume this is out of your control and we must wait for an update from eslint and lz4 but is it possible to create a version that will support an LTS version of Node? Or warn users that the current version must be used?
@scott16lloyd Thank you for those details! I need to check if we can do anything on our side. I think upgrading
eslintshould be painless, and if it doesn't depend on punycode anymore - I'll do that. ForBufferwarnings -new Buffer(...)is also widely used innode-int64which is quite old and doesn't receive updates, butthriftheavily depends on it. While those are just warnings and don't disrupt your workflow - you can ignore them for now. I'll get back to you when I have any updatesI am getting the same error on newer Node JS versions (20.16.0) But the error goes away on an earlier version (18.18.2)
Having the same problem using Next JS 14. Any solution?
Has anyone managed to solve this?
Having the same problem using Next JS 14. Any solution?
Did you find any solution to use in nextjs?
Previously working code causing a
TypeError: Cannot read properties of undefined (reading '0'). This code is from the following example: https://github.com/databricks/databricks-sql-nodejs/blob/HEAD/examples/usage.jsConsole output:
The only change made was adding:
to my next.config.js to prevent the following error: