Audrow
Audrow
DDeno
Created by Audrow on 3/20/2024 in #help
Error in npm package - how to squelch?
I'm using an npm package that I think isn't being processed for Deno correctly. I get this error:
This expression is not constructable.
Type 'typeof import("file:///Users/audrow/Library/Caches/deno/npm/registry.npmjs.org/sitemapper/3.2.8/sitemapper")' has no construct signatures.deno-ts(2351)
This expression is not constructable.
Type 'typeof import("file:///Users/audrow/Library/Caches/deno/npm/registry.npmjs.org/sitemapper/3.2.8/sitemapper")' has no construct signatures.deno-ts(2351)
I can deno run it and it works fine. But is there a way to remove the error from my editor? Here's a minimal code example. I'm using Deno 1.41.3.
import Sitemapper from 'npm:sitemapper'

const distro = 'rolling'
const url = `https://docs.ros.org/en/${distro}/sitemap.xml`

const sitemap = new Sitemapper();
const {sites} = await sitemap.fetch(url);
console.log(sites);
import Sitemapper from 'npm:sitemapper'

const distro = 'rolling'
const url = `https://docs.ros.org/en/${distro}/sitemap.xml`

const sitemap = new Sitemapper();
const {sites} = await sitemap.fetch(url);
console.log(sites);
2 replies
DDeno
Created by Audrow on 12/17/2022 in #help
Websocket client with headers
I'm trying to create a websocket client that has an authorization header. It seems that a lot of the functionality of websockets has been moved out of the standard library, and I don't see much in the core. Any advice on how to proceed? For reference, I'm trying to do the following in Deno, rather than by using websocat: https://trading-api.readme.io/reference/introduction#connecting
37 replies