DenoDDeno
Powered by
CanadaHonkC
Denoβ€’3y agoβ€’
1 reply
CanadaHonk

Dynamically importing NPM modules errors

The following works fine in Node:
const parser = 'acorn';
const { parse } = await import(parser);
const parser = 'acorn';
const { parse } = await import(parser);


But with Deno gives the error:
Uncaught (in promise) TypeError: Loading unprepared module: npm:acorn@^8.9.0
Uncaught (in promise) TypeError: Loading unprepared module: npm:acorn@^8.9.0


Not sure what I should do to "prepare" it since I can't find any information on it?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Trouble importing npm modules
beermanBbeerman / help
4y ago
Importing internal modules
it's em!Iit's em! / help
3y ago
Trouble importing modules
beermanBbeerman / help
4y ago