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
Angular 17 & new Vite builder: When Angular app is built, @Entity metadata is lost #303
Comments
I've tried it and I'm not getting the same error - here's the project I tested with: It's angular 17 with the new vite project - can you check it out - and let me know the difference? My guess is the "experimentalDecorators" flag missing from the tsconfig used by angular to build Let me know -you can also reach me directly on our discord |
@noam-honig thanks for quick reply again. experimentalDecorators wasn't it, was already enabled. I copied all entities from the Remult app to under the Angular app and imported them from there, and then everything works. So seems when entities are imported from outside the Angular project structure, metadata is stripped when built with I want to keep backend and frontend apps separated so I will keep tinkering. If you have any quick bright ideas I welcome them =)) Fyi I have a root tsconfig.json where I define some paths, and is extended by all apps in this repo. Angular imports entities from
|
I traced it to
Replace with:
Edit: Nope this workaround didn't quite work, new error when trying to call repo.find :D
|
This workaround worked:
Angular:
Nothing that can be on the Remult side of things to avoid doing this comes to my mind, but I'm not that smart so maybe you figure out something better :D |
I think it makes sense that Remult should only be loaded once. Have you tried tools like pnpm or npm workspaces to get Remult installed once at the top-level node_modules? |
Everything works while running
ng serve
but afterng build
with either dev or prod conf, Remult can't find entity metadata and all Repository methods fail. Any ideas how to fix this?I am running Remult in Bun as a separate project, so it's not compiled with the Angular compiler.
Error:
The text was updated successfully, but these errors were encountered: