ably-js icon indicating copy to clipboard operation
ably-js copied to clipboard

Cannot find module 'ably/promises' or its corresponding type declarations.

Open abmercy035 opened this issue 6 months ago • 1 comments

import * as Ably from 'ably/promises';

throws and error in a NextJs Typescript project.

Cannot find module 'ably/promises' or its corresponding type declarations.

┆Issue is synchronized with this Jira Task by Unito

abmercy035 avatar Jul 09 '25 17:07 abmercy035

Hi @abmercy035 ! Are you using the ably-js v2? If so, starting with version 2, ably-js no longer offers a choice between a callbacks-based API and a promises-based API, and it's promise-based by default. As such, there is no longer an ably/promises export available and you should just use ably (more in the v2 migration guide):

import * as Ably from 'ably';

VeskeR avatar Jul 09 '25 22:07 VeskeR