wulfey
wulfey2y ago

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

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?
35 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wulfey
wulfey2y ago
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
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wulfey
wulfey2y ago
8 | import { Dummy } from "./lib/sources/dummy.ts"; It imports it directly
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wulfey
wulfey2y ago
Although then, weird how everything else that imports anything from [entryfile] doesnt come up with the issue
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wulfey
wulfey2y ago
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
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wulfey
wulfey2y ago
Nope, I'd argue it might even be the last one
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wulfey
wulfey2y ago
What's considered a "circular dependency"
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
wulfey
wulfey2y ago
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:
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View