SchmukiS
Denoβ€’3y agoβ€’
2 replies
Schmuki

Importing NPM Packages in Deno Throws 'Uncaught SyntaxError' for Specific Modules

Hi there, I'm relatively new to Deno. I'm running into an error with an NPM package import.
import { BskyAgent } from "npm:@atproto/api";

const agent = new BskyAgent({
  /* Agent options */
});

error: Uncaught SyntaxError: The requested module 'npm:@atproto/api' does not provide an export named 'BskyAgent'
import { BskyAgent } from "npm:@atproto/api";
         ^
    at <anonymous> (file:///Users/<username>/Desktop/deno/main.ts:1:10)
Watcher Process failed. Restarting on file change...

The code works fine with NodeJS. I've tried using Deno run with the
--unstable
flag but got the same error message. I've also tried other packages (express for example) which worked just fine. Am I doing something wrong here? Do I need to configure something to get the package to work with Deno?
Was this page helpful?