D
Deno

help

Certain code prevents Deno from doing anything

RRihan11/27/2023
Any time I try and use Deno with npm:zeromq@6.0.0-beta.19, running my code has absolutely no output whatsoever, even breaking console.log() at the beginning of the file. I've tried running with a debugger but I get no output there too. This is the module I'm trying to run, which wraps around the C library Libzmq under the hood. https://github.com/zeromq/zeromq.js
// minimal-repro.ts
// deno run --allow-all minimal-repro.ts

import * as zmq from "npm:zeromq@6.0.0-beta.19";

console.log("testing");
const sock = new zmq.Request(); // commenting this out will fix showing "testing" in console
// minimal-repro.ts
// deno run --allow-all minimal-repro.ts

import * as zmq from "npm:zeromq@6.0.0-beta.19";

console.log("testing");
const sock = new zmq.Request(); // commenting this out will fix showing "testing" in console
deno 1.38.3 (release, x86_64-pc-windows-msvc) v8 12.0.267.1 typescript 5.2.2 Edition Windows 11 Pro Version 23H2 Installed on β€Ž09/β€Ž05/β€Ž2023 OS build 22631.2787 Experience Windows Feature Experience Pack 1000.22681.1000.0
This is my first time with Deno and I think I'm pushing the limits of npm/node compatibility right off the bat. I wanted to use Deno for my assignment to get some experience with it as it really appeals to me over Node.js. I've attached screenshots comparing what happens when I run with/without commenting out the usage of the zeromq library. I'm confused why I'd get no output whatsoever, with console.log() suddenly stop working. Please suggest how I can try and run Deno more verbose/debug logs, or any other recommendations so I can get this working. πŸ™‚
GitHub
GitHub - zeromq/zeromq.js: :zap: Node.js bindings to the ØMQ library
:zap: Node.js bindings to the ØMQ library. Contribute to zeromq/zeromq.js development by creating an account on GitHub.
Usage of zmq lib uncommented
Usage of zmq lib commented out
DAHDeno AI Helper11/27/2023
I'm sorry to hear that you're having trouble with Deno and the zeromq library. It's great that you're trying to push the limits and explore Deno's compatibility with npm and Node.js modules. πŸ¦• From the documentation, it's clear that Deno has made significant strides in supporting npm packages, but it's also noted that this support is experimental and there might be scenarios where something doesn't work as expected. The zeromq library, which you're trying to use, might be one of those cases. The zeromq library is a native Node.js module that provides bindings to the ZeroMQ library. Native modules are particularly challenging because they often rely on Node.js-specific APIs and they require a build step that involves compiling C or C++ code. This is something that Deno doesn't currently support out of the box. The lack of output or error messages is indeed puzzling. One possibility is that the zeromq library or one of its dependencies is causing the Deno process to crash or hang before it has a chance to output anything. To get more information about what's happening, you can try running Deno with the --unstable and --inspect flags. This will enable some unstable APIs and allow you to connect a debugger. Here's how you can do it:
deno run --unstable --inspect --allow-all minimal-repro.ts
deno run --unstable --inspect --allow-all minimal-repro.ts
Then, open chrome://inspect in Chrome or Edge, and click on the "Inspect" link under "Remote Target". This should open a DevTools window where you can see console output, set breakpoints, step through the code, and inspect variables. If this doesn't help, it might be worth reaching out to the Deno community for help. You can do this by opening an issue on the Deno GitHub repository. Be sure to include all the details you've provided here, as well as any
DAHDeno AI Helper11/27/2023
additional information you can gather from using the debugger. I hope this helps, and don't hesitate to ask if you have more questions!
Mmarvinh.11/27/2023
@Rihan That looks like an issue to me. Can you file an issue here by pasting your message into the text box? https://github.com/denoland/deno/issues/new FYI: I've copied and pasted the messages here into a GH issue https://github.com/denoland/deno/issues/21356 whoops just saw that you've already opened one
RRihan11/28/2023
Thanks! Sorry for not linking it here earlier. I remembered to do so just now Also, just want to say I love your blog posts! They have been incredibly interesting reads
Mmarvinh.11/28/2023
Thanks for the kind words! They're are always fun to write because you always discover something new

Looking for more? Join the community!

Recommended Posts
Custom `401 Unauthorized` error page, similar to builtin `404 Not Found`?How can I create a custom error page that is rendered by middleware in Fresh? The middleware handlesUsing `deno_emit` from Rust: building import graphI'm trying to use `deno_emit` from Rust to bundle modules. I already evaluated these modules with `dNPM Packages Usage on deno_core ?Hello, I'm visiting from https://deno.com/blog/roll-your-own-javascript-runtime-pt2. Utilizing JSRun`deno.disablePaths` doesn't workHi in `.vscode\settings.json` I have this: ```json { "deno.disablePaths": ["**/kit", "./kit", ".What is the correct syntax to set the `compilerOptions.types` to use npm @types libraryFor example: As of now if I want my .ts files to have access to the `npm:express` packages `@types/Using "imports" in deno.json doesn't work in VS.code* deno 1.38.3 * vs.code 1.84.2 * denoland.vscode-deno 3.28.0 I got rid of my import map and moved tdeno repl start time in containerWhy does deno repl take a couple seconds to start in a container the second time around, and starts How to detect when --watch flag has been passed to `deno run` programatically?I am writing a small cli script, and I have a few bits of code that do not play nicely with `deno ruHelp with npm peerDependenciesHi πŸ‘‹ I am using an npm library that has `@sinclair/typebox` listed under `peerDependencies`. It giAWS Lambda configHow do i set permissions in deno for aws lambda. Like --allow-env etcMigrating from EventEmitter…Hi! I've got some legacy code that depends on `node:events` 's `EventEmitter` class, specifically itusing flexsearchso flexsearch has a index.d.ts thats broken and hasn't been touched in 2ish years and instead you shDoes Deno third party modules support to wrap NPM in importmapHere is my first module: https://deno.land/x/lume_fluent@1.0.0-alpha My importmap for the module isHelp using DenoMaileri'm trying to use it but i get Deno is not defined when i try to send the email, any tips? how wouldDebug all tests in VSCodeHi everyone. I was hoping to use the equivalent of "deno test" in such a way that I can set a breakMost complete Deno Rust runtime?I’m trying to embed the Deno runtime into my Rust program. I’m looking for the most β€œcomplete” Deno Language server crashing in VSC outside of deno projectsHow to write a new project template scriptHey, I've written a small game engine to create text adventures in Deno. The resulting project is a Seamlessly include TailwindcssIs there a recommended way of achieving this at the moment? What is the cleneast way of including tatidy up `deno.lock`Hey, is there something like `go mod tidy` (https://golangbyexample.com/go-mod-tidy/) in Deno? The b