Hey everyone, I’m stuck with a weird issue in my Angular 18 project. I’ve got an external component library linked with npm link, but I’m encountering a strange error:
Property '@ɵINPUT_SIGNAL_BRAND_WRITE_TYPE@10192' does not exist on type 'InputSignal<boolean | undefined>'.
Did you mean '@ɵINPUT_SIGNAL_BRAND_WRITE_TYPE@16910'?
This happens when I use components from the linked library that use signal properties defined with input<type>(). For example, one of the library components has a property called hasBackground, and binding a value to it in my project triggers this error. Has anyone experienced this issue? Any suggestions or workarounds would be greatly appreciated. Thanks for your help!
I’ve encountered a similar issue when working with Angular 18 and linked libraries. The error you’re seeing is often related to compilation differences between your project and the linked library. One approach that worked for me was to ensure both the main project and the library are using the same version of Angular and TypeScript.
Try updating your library’s package.json to match the exact versions used in your main project, particularly for @angular/core and typescript. After that, rebuild the library and re-link it. If the problem persists, you might want to consider using npm workspaces instead of npm link for a more stable development environment.
Another potential solution is to use the --preserve-symlinks flag when building your main project. This can sometimes resolve issues with linked dependencies. Hope this helps you resolve the input signal error!
I’ve run into this issue before with Angular 18 and linked libraries. It’s usually caused by a mismatch in the Angular versions or how the components are compiled. Here’s what worked for me:
First, ensure your main project and the linked library use the exact same Angular version. Check the package.json files and align them if needed.
If that doesn’t solve it, try rebuilding your library with the --configuration production flag. This forces AOT compilation, which can sometimes resolve these input signal errors.
Lastly, if you’re still having trouble, consider using ng-packagr to build your library instead of the standard Angular CLI. It handles dependency resolution better in some cases.
Remember to clean your node_modules and reinstall after making these changes. Good luck!
hey isaac, sounds like a version mismatch. npm link can be tricky w/ angular. try using npm pack for ur library instead. pack it, then install the .tgz file in ur project. that might fix the input signal error. lmk if it helps!