-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access entities in frontend #1
Comments
I'm facing the same problems!!
This is what vite says to me. @will2hew do you have ideas on how to investigate this or to patch a solution? |
I haven't looked at this issue recently, but I'd recommend creating separate types with something like a DTO for where you're passing data between the backend and frontend. There are several instances of types that will not appropriately serialize to JSON and should be handled explicitly e.g. dates, will get serialized to a string, but not serialized back to a date object. |
Thanks for your insights! I was experimenting around with Nuxt and Typeorm with a different configuration, that somewhat was able to let me use the same classes and interfaces with both the backend and the frontend. With vite, it all boiled down to using these settings in
Since, for my understanding, the esbuild bundler doesnt support emitDecoratorMetadata (as per this issue). |
There are currently Vite errors when attempting to import entities in the frontend. This would be a meaningful quality of life improvement to avoid having to re-create interfaces in frontend code.
The text was updated successfully, but these errors were encountered: