Ram Durga Sai
Ram Durga Sai7mo ago

NPM Packages Usage on deno_core ?

Hello, I'm visiting from https://deno.com/blog/roll-your-own-javascript-runtime-pt2. Utilizing JSRuntime within Rust was fantastic. I encountered an issue when attempting to load npm packages/CDNs in JS code. The error message I received is: TypeError: Module loading is not supported; attempted to load: "https://dev.jspm.io/xxxx" from "(no referrer)"
1 Reply
Deno AI Helper
Deno AI Helper7mo ago
Based on the documentation, Deno does support loading npm packages, but it does so in a different way compared to Node.js. In Deno, you can import npm packages directly using URLs, and Deno will handle the downloading and caching of the modules for you. However, the error message you're seeing suggests that the module loading isn't supported in your current context. This might be due to the fact that you're trying to load the module within the deno_core Rust context, which might not have the same module loading capabilities as the Deno runtime itself. Unfortunately, the documentation does not provide a clear solution for this specific issue. It might be helpful to check if the module you're trying to load is compatible with Deno, or if there's a Deno-specific way to load the module within the deno_core context. If you're still having trouble, it might be a good idea to file an issue on the Deno GitHub page for more assistance.