spartan
spartan copied to clipboard
NG0311: Directive CdkMenuTrigger does not have an input with a public name of brnMenuTriggerFor.
Please provide the environment you discovered this bug in.
I have configured everything correctly in the vite config, but when I run the project with AnalogJS with ssr enabled, i run into this issue.
Which area/package is the issue in?
menubar
Description
The issue arises from the BrnMenuTriggerDirective, while I was trying to use it for a menubar.
Please provide the exception or error you saw
An error occured while server rendering /index.html:
NG0311: Directive CdkMenuTrigger does not have an input with a public name of brnMenuTriggerFor.
Error: NG0311: Directive CdkMenuTrigger does not have an input with a public name of brnMenuTriggerFor.
at validateMappings (C:\Users\Aaron\Projects\packages\core\src\error_details_base_url.ts:19129:23)
at validateHostDirective (C:\Users\Aaron\Projects\packages\core\src\error_details_base_url.ts:19114:5)
at Object.findHostDirectiveDefs (C:\Users\Aaron\Projects\packages\core\src\error_details_base_url.ts:19035:17)
at findDirectiveDefMatches (C:\Users\Aaron\Projects\packages\core\src\error_details_base_url.ts:12362:48)
at resolveDirectives (C:\Users\Aaron\Projects\packages\core\src\error_details_base_url.ts:12127:29)
at elementStartFirstCreatePass (C:\Users\Aaron\Projects\packages\core\src\error_details_base_url.ts:24247:5)
at ɵɵelementStart (C:\Users\Aaron\Projects\packages\core\src\error_details_base_url.ts:24283:11)
at ProfileMenuComponent_Template (C:\Users\Aaron\Projects\eternumlol\boostdemo-analog\src\app\ui-components\profile-menu.component.ts:63:43)
at executeTemplate (C:\Users\Aaron\Projects\packages\core\src\error_details_base_url.ts:11620:9)
at renderView (C:\Users\Aaron\Projects\packages\core\src\error_details_base_url.ts:12827:13
Other information
No response
I would be willing to submit a PR to fix this issue
- [ ] Yes
- [X] No
Fixed by using the actual CdkMenuTrigger, and then doing [cdkMenuTriggerFor]="menu" instead of [brnMenuTriggerFor], what's the issue here?
I've had this issue too, this is the cause angular/angular#54096.
I'm also temporarily using the actual cdkMenuTrigger, there's only one error that occurs when clicking the trigger TypeError: Cannot read properties of undefined (reading 'originY'), but other than that it works fine.
@DevWedeloper seems like the upstream issue got merged and this should be fixed with 18.2?
@goetzrobin Yup, it's already fixed with that version.
@aaron47 spartan is now running on 18.2.5 so once you upgrade your project to that version it should also resolve this issue!