-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Which package/packages do you use?
-
@stream-io/video-react-sdk -
@stream-io/video-react-native-sdk -
@stream-io/video-client
Describe the bug
Some files and the documentation import types using a regular import instead of import type.
This can cause issues with certain build tools like Vite or Next.js and goes against TypeScript best practices.
For example, in the SDK source and docs:
import {
AllClientEvents,
ClientEventListener,
Logger,
StreamClientOptions,
TokenOrProvider,
TokenProvider,
User,
UserWithId,
} from './coordinator/connection/types';This should instead be:
import type {
AllClientEvents,
ClientEventListener,
Logger,
StreamClientOptions,
TokenOrProvider,
TokenProvider,
User,
UserWithId,
} from './coordinator/connection/types';To Reproduce
- Follow the React SDK documentation [here](https://getstream.io/video/docs/react.md).
- Copy a snippet where these types are imported directly.
- Run the project in a TypeScript environment with strict settings (e.g., using Vite).
- Observe build warnings or potential runtime issues related to incorrect type imports.
Expected behavior
-
Types should be imported using
import typeso they are:- Clearly recognized as type-only imports.
- Removed from the compiled JavaScript output.
- Compatible with bundlers and strict TypeScript settings.
Screenshots
in this User is an type, but it is importing directly
Additional context
This issue appears in both:
- The SDK source code.
- The official documentation snippets.
Switching to import type fixed issues for me when using Vite with strict TypeScript settings.
This is also a recommended TypeScript best practice and helps with tree-shaking and clearer code.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request