ATX
ATX•8mo ago

Cannot find namespace NodeJS

Hi Context: using deno with npm lib (imap). There seems to be a missing/unresolved to NodeJS that is messing u my deno check (methods inherited from EventEmitter are not know). Any idea whats wrong ? Research of exising discussion do not seems to highlight a solution : https://discord.com/channels/684898665143206084/689420767620104201/985919380875534347 https://discord.com/channels/684898665143206084/685193730114060300/1125389378965995601
No description
3 Replies
Deno AI Helper
Deno AI Helper•8mo ago
Hello! I wasn't able to find the answer to your question in the official Deno documentation. However, based on the context you've provided, it seems like you're trying to use an npm library that relies on Node.js-specific APIs with Deno. Deno does not have the NodeJS namespace because it is a separate runtime from Node.js and does not include Node.js globals by default. If you're using a library that depends on Node.js-specific features, you might encounter issues because Deno is not designed to be API-compatible with Node.js. Deno has its own set of APIs and a different standard library. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. If you need to use Node.js-specific libraries, you might have to look for Deno-compatible alternatives or use a compatibility layer like npm:@denoify/npm which attempts to provide some Node.js APIs in Deno. However, not all Node.js APIs and libraries are supported by such compatibility layers, so your mileage may vary. For the EventEmitter issue, you might want to ensure that you're importing or defining the necessary types to satisfy Deno's type checker. If the library you're using is not designed with Deno in mind, you may need to provide your own type definitions or contribute to the library to add Deno support. Remember to always refer to the official Deno documentation and resources for the most accurate and up-to-date information.
ATX
ATX•8mo ago
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Symbol(Deno.internal.rid)')
at TCP.#read (ext:deno_node/internal_binding/stream_wrap.ts:220:45)
at TCP.readStart (ext:deno_node/internal_binding/stream_wrap.ts:90:17)
at _tryReadStart (node:net:276:30)
at TLSSocket._read (node:net:856:7)
at TLSSocket.Readable.read (ext:deno_node/_stream.mjs:2999:16)
at TLSSocket.read (node:net:789:34)
at nReadingNextTick (ext:deno_node/_stream.mjs:3328:13)
at Array.processTicksAndRejections (ext:deno_node/_next_tick.ts:30:15)
at eventLoopTick (ext:core/01_core.js:62:29)
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Symbol(Deno.internal.rid)')
at TCP.#read (ext:deno_node/internal_binding/stream_wrap.ts:220:45)
at TCP.readStart (ext:deno_node/internal_binding/stream_wrap.ts:90:17)
at _tryReadStart (node:net:276:30)
at TLSSocket._read (node:net:856:7)
at TLSSocket.Readable.read (ext:deno_node/_stream.mjs:2999:16)
at TLSSocket.read (node:net:789:34)
at nReadingNextTick (ext:deno_node/_stream.mjs:3328:13)
at Array.processTicksAndRejections (ext:deno_node/_next_tick.ts:30:15)
at eventLoopTick (ext:core/01_core.js:62:29)
After fixing my error (not using it), I have network style issues. I more and more think that npm:Imap is nok with deno ,and that there is no alternative 😢