nylas / nylas-nodejs

A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.
MIT License
166 stars 116 forks source link

`This expression is not constructable.` with beta client in Deno #520

Closed KazimirPodolski closed 7 months ago

KazimirPodolski commented 7 months ago

Describe the bug Curernt beta SDK with TypeScript 5.2.2 under Deno (tho it should be the same with Node?..) gives This expression is not constructable.

To Reproduce

import Nylas from 'npm:nylas@7.0.0-beta.3'

const nylas = new Nylas({apiKey: Deno.env.get('NYLAS_API_KEY')!})

image

Expected behavior No error.

SDK Version: 7.0.0-beta.3

Additional context This weird way seems to work:

import {default as Nylas} from 'npm:nylas@7.0.0-beta.3'

const nylas = new Nylas.default({apiKey: Deno.env.get('NYLAS_API_KEY')!})
KazimirPodolski commented 7 months ago

Oops it seems to be only an IDE error problem, not runtime problem. Normal version actually works and "default" one doesn't.