D
Deno

help

Resolving 'dynamically imported module evaluation pending, but no pending ops'

Wwulfey10/24/2022
I've been getting this error quite a lot, but I haven't found a single way to know which unresolved promises cause it.
error: Dynamically imported module evaluation is still pending but there are no pending ops. This situation is often caused by unresolved promises.
Pending dynamic modules:
- file:///home/user/Desktop/js/denolasvegas/commands/main/CATEGORY.ts
error: Dynamically imported module evaluation is still pending but there are no pending ops. This situation is often caused by unresolved promises.
Pending dynamic modules:
- file:///home/user/Desktop/js/denolasvegas/commands/main/CATEGORY.ts
Any tips on what to do to find the cause of these cases?
UUUnknown User10/24/2022
Message Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
import { CategoryInitializer } from "../../lib/commandhandler/mod.ts";
// [1] Removing the "Dummy" source initializer and any references fixes the issue
import { Dummy } from "../../lib/sources/dummy.ts";
import { TrollegleSources } from "../../trollegle.ts";

export default new CategoryInitializer<TrollegleSources>({
name: "Main",
description: "The main command category every user can use",
prefices: ["/"],
async permitted(user) {
// Check [1]
if (!(user.connection instanceof Dummy))
return await user.connection.send("no"), false;
return true;
},
});
import { CategoryInitializer } from "../../lib/commandhandler/mod.ts";
// [1] Removing the "Dummy" source initializer and any references fixes the issue
import { Dummy } from "../../lib/sources/dummy.ts";
import { TrollegleSources } from "../../trollegle.ts";

export default new CategoryInitializer<TrollegleSources>({
name: "Main",
description: "The main command category every user can use",
prefices: ["/"],
async permitted(user) {
// Check [1]
if (!(user.connection instanceof Dummy))
return await user.connection.send("no"), false;
return true;
},
});
It is worth noting the topmost contents of dummy.ts as well:
import { cli } from "../../trollegle.ts";
import CLI, { CLIEvent } from "../cli/mod.ts";
import {
CoreEvents,
BaseDummySource,
EndReason,
CoreSourceEvents,
ConnectOptions,
} from "./types.ts";

// ...
import { cli } from "../../trollegle.ts";
import CLI, { CLIEvent } from "../cli/mod.ts";
import {
CoreEvents,
BaseDummySource,
EndReason,
CoreSourceEvents,
ConnectOptions,
} from "./types.ts";

// ...
assuming that "../../trollegle.ts" is the entry file
UUUnknown User10/24/2022
3 Messages Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
8 | import { Dummy } from "./lib/sources/dummy.ts"; It imports it directly
UUUnknown User10/24/2022
Message Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
Although then, weird how everything else that imports anything from [entryfile] doesnt come up with the issue
UUUnknown User10/24/2022
3 Messages Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
dummy.ts among other files regarding various initializers go before CATEGORY.ts Maybe it's not possible to import from a file that directly imports said file
UUUnknown User10/24/2022
Message Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
Nope, I'd argue it might even be the last one
UUUnknown User10/24/2022
4 Messages Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
What's considered a "circular dependency"
UUUnknown User10/24/2022
4 Messages Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
That's why I wanted to ask, because I already do something similar (excluding CATEGORY.ts) which does not produce the error Okay, what about this:
UUUnknown User10/24/2022
2 Messages Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
Okay that may be useful
UUUnknown User10/24/2022
2 Messages Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
Right, but how would I do the following: have an entry file declare some useful things, such as class initializations having the entry file import (execute) other files which require importing of those useful things from the entry file Also, since these are dynamic imports, can't use deno info Okay, turns out it was because I was importing from the entry file while it had a top-level await operation hanging
UUUnknown User10/24/2022
4 Messages Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
actually its just the "await completion of method init of Trollegle<TrollegleSources>"
UUUnknown User10/24/2022
Message Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
yeah
UUUnknown User10/24/2022
Message Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
its basically "wait for the initializer to complete initializing a thing which initializes a thing that initializes another thing which imports the entry file" "which is waiting for the initializer to complete <ref *1>"
UUUnknown User10/24/2022
Message Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
very uninformative error though also thank you, yes, i forgot to say that
UUUnknown User10/24/2022
2 Messages Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
it would be better if it were just like
error: Dynamically imported module evaluation is still pending but there are no pending ops. This situation is often caused by unresolved promises.
Pending dynamic modules:
- file:///home/user/Desktop/js/denolasvegas/commands/main/CATEGORY.ts
at file:///home/user/Desktop/js/denolasvegas/commands/main/CATEGORY.ts:2:1
at file:///home/user/Desktop/js/denolasvegas/lib/sources/dummy.ts:1:1
import { cli } from "../../trollegle.ts";
^^^^^^
Modules which are being evaluated cannot be imported from
error: Dynamically imported module evaluation is still pending but there are no pending ops. This situation is often caused by unresolved promises.
Pending dynamic modules:
- file:///home/user/Desktop/js/denolasvegas/commands/main/CATEGORY.ts
at file:///home/user/Desktop/js/denolasvegas/commands/main/CATEGORY.ts:2:1
at file:///home/user/Desktop/js/denolasvegas/lib/sources/dummy.ts:1:1
import { cli } from "../../trollegle.ts";
^^^^^^
Modules which are being evaluated cannot be imported from
like whatever the issue is, but too bad im not a deno developer
UUUnknown User10/24/2022
2 Messages Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
^
UUUnknown User10/24/2022
Message Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
i doubt they'd just put a dumb error with 0 verbosity if they could make it include some information
UUUnknown User10/24/2022
2 Messages Not Public
Sign In & Join Server To View
Wwulfey10/24/2022
you are somewhat familiar with rust? thats neat anyways, thanks for helping out
UUUnknown User10/24/2022
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

Recommended Posts
http serve and serveTls using async iterator cannot serve multiple domains```javascript async f_serveTls() { var o_self = this // check if ssl cert existsHow to test if a file was created?I'm making a deno library that creates some folders and files, how can i check if it generates then Deno bundle duplicating variablesUsing Deno 1.26.2 I am trying to bundle https://github.com/Savory/Danet-Starter using `deno bundle Simple test, lots of type errorsHi! I made a library for Deno (https://github.com/Industrial/fresh-emotion) and am now trying to adAm I closing this server wrongly? The port is not free for a new listener! (`AddrInUse`)```ts const server = Deno.listen({ port: 80 }); (async function(){ for await(const conn of serSync uuid from stringHow can I generate a UUID from a string synchronously? In the standard library I only found this asVS Code, Hello World -- F5 shows nothing in console?I have a simple hello world program: ```ts let message: string = 'Hello World'; console.log(messageHow to transform a Readable Stream to a file.I have a ReadableStream from a post request and i cant find a way to transform the body(ReadableStreSilence error logs on Oak serverI'm trying to silence specific errors on an Oak server on Deploy. A Github issue said to add an 'errAre pointers supported in Fast API return types?If no, how do I return pointers?Reddit fetch Vs. My noob brain part. IHello! So I want to fetch Reddit posts. I use this library. I have a few questions. https://github.cHow do I detect mouse clicks and key presses with Deno.stdin?I don't even really have any base code, so I was just wondering as to how do I do the problem specifML with FFISuppose you wish to do some machine learning stuff with Deno, would it be optimal to use FFI with C Is there a way to determine what modules have been dynamically imported at runtime?The builtin tools to compile/bundle/vendor don't account for dynamic imports (understandably), but iweird interfacehow can a class implement this interface ```ts interface I { (): void type: string }``` or a `cnpm specifier import typesso when I do something like ```ts import * as rx from 'npm:rxjs' console.log(rx) ``` I do have the error Unsupported scheme node for module `nodemodule`. Supported schemesI'm trying to import a module using: ```js import { example } from "npm:example"; ``` Inside `examplesbuild_deno_loader importing Deno modulesA dependancy I use imports modules like "fs" and I want esbuild_deno_loader to treat them as externaIs there a good dataframe library for deno?I use the nodejs bindings for pola.rs for now but I'd like to move from nodejs to deno. This is my ltype a whole directory to make sure each file in the directory exports a default module of a type.Can you type a whole directory to make sure that every file in the directory is exporting a default