D
Deno

help

Dynamically imported module evaluation is still pending

Mmoublini9/30/2022
I'm very confused on the error i put as the title because in my program i'm trying to just import some files in a directory and i get this really not self explainatory error, does somebody know anything? Thanks 😁 Code:
const comuneEventDir = path.resolve(__dirname, './events');
const eventDir = Deno.readDirSync(comuneEventDir);
for (const file of eventDir) {

if (!file.name.match(/^.*\.ts$/)) continue;
console.log(`importing ${comuneEventDir}/${file.name}...`)
await import(`${comuneEventDir}/${file.name}`);

}
const comuneEventDir = path.resolve(__dirname, './events');
const eventDir = Deno.readDirSync(comuneEventDir);
for (const file of eventDir) {

if (!file.name.match(/^.*\.ts$/)) continue;
console.log(`importing ${comuneEventDir}/${file.name}...`)
await import(`${comuneEventDir}/${file.name}`);

}
ABTAndreu Botella (they/them)9/30/2022
If this code is inside an async function, make sure it's being called with await
Mmoublini9/30/2022
this loop is in the top level of the file
ABTAndreu Botella (they/them)9/30/2022
And that if those calls are in other async functions, that those are also called with await, and so on Oh
UUUnknown User9/30/2022
3 Messages Not Public
Sign In & Join Server To View
Mmoublini9/30/2022
deno run

Looking for more? Join the community!

Recommended Posts
How to setup CORS with serve? I get 403 forbidden.I've setup the following headers (OPTIONS response): ``` new Response(null, { status: 204, headeDynamic npm imports don't workHey there. It looks like dynamic imports don't work with `npm` specifiers. For example: ``` await iUnable to make local session persistence with Firebase Auth on Deno FreshHello I'm running a basic app for testing firebase auth. My implementation is as follows: - The finewbie help on deploying first project to denoI asked on deno github and was told to ask on discord: https://github.com/denoland/deno/discussions/How to exclude vendor directory from test coverage?https://deno.land/manual@v1.25.4/testing/coverage Here it says by default it will exclude `test\.(tsHow exactly do import maps work?My import map works but I don't understand how! ```"/": "./src/", "./": "./",``` If I import `/a/b/does not provide an export named... module importdoes anybody know whats going on, when i reload my page only sometimes i get this message : ``` ThWrite to virtual file pathIs it possible to provide virtual file paths so that another package writes a file to a variable in Request.body.getReader() into Uint8Array typed arrayis it possible to convert a `readableStream` into a `Uint8Array` ?serving two static folders and connecting to both with websocketsA lot of the youtube and medium resources available on setting serving static folders, and on settini need a regex that matches, from a double quote to a double quote and has two fullstop between it.i need a regex that matches, from a `"` to a `"` and has two `.` between it for example, `"fjhhdjkdimport a locel module from a webmoduleI have a module that i inport into my local scope and that module should also import a module from mSwitching to forums for helpThe old channel is at #old-help and will be archived in a few days.