React typescript compilation error when importing Static<typeof userSchema> as type #3175
Unanswered
pipwarrior
asked this question in
Q&A
Replies: 1 comment
-
It looks like your bundler is pulling in the actual file. This shouldn't happen when importing the typed client itself which also re-exports your application types so you can do: import type { UserData, User } from 'my-app' |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Steps to reproduce
On my React app, i imported all interfaces from the FeathersJS webserver into a server-interface.ts file
export type User = import('../../../../webserver/src/services/users/users.schema').User;
Imported the User interface
import { User } from '../server-interface';
export const createUser = (data: Partial<User>): Promise<User> => ( userFeathersService.create(data) );
React compilation error:
Expected behavior
Tell us what should happen
Actual behavior
Tell us what happens instead
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
NodeJS version:
Operating System:
Browser Version:
React Native Version:
Module Loader:
Beta Was this translation helpful? Give feedback.
All reactions