anycable-client icon indicating copy to clipboard operation
anycable-client copied to clipboard

The return type for `createCable` is unresolved/any instead of Cable

Open kcrwfrd opened this issue 1 year ago • 1 comments

Screenshot 2024-04-25 at 2 26 57 PM

This is causing type errors in our project when trying to use anycable.

I think you need to import all of the imports from @anycable/core, not export them.

import {
  CreateOptions,
  Cable,
  ActionCableConsumer,
  TokenRefresher
} from '@anycable/core'

// is this necessary?
export { CreateOptions, Cable, ActionCableConsumer, TokenRefresher }

kcrwfrd avatar Apr 25 '24 21:04 kcrwfrd

Thanks for the report!

It looks like it's gonna be fixed by #38.

I think you need to import all of the imports from @anycable/core, not export them.

We re-export types for usability (so, you can import all you need from the @anycable/web package without event knowing that @anycable/core exists and think about what to import from where).

palkan avatar Apr 26 '24 19:04 palkan

Should be fixed in v0.9.0. Please, let me no if the problem still there, and we'll reopen it.

palkan avatar May 21 '24 23:05 palkan