Skip to content
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

fix(menubar.ts): hoist Menubar class declaration #13270

Closed
wants to merge 1 commit into from
Closed

fix(menubar.ts): hoist Menubar class declaration #13270

wants to merge 1 commit into from

Conversation

timurongh
Copy link

In node_modules/primeng/fesm2022/primeng-menubar.mjs, Menubar is referenced in MenubarSub's constructor on line 157:

static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: MenubarSub, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: MenubarService }, { token: Menubar }], target: i0.ɵɵFactoryTarget.Component });

but the Menubar class is declared below on line 363. Because class declarations are not hoisted, it leads to this runtime error reported in #13024:

    ReferenceError: Cannot access 'Menubar' before initialization

    >  9 | import { MenubarModule } from 'primeng/menubar';
         | ^

This MR hoists the Menubar class declaration above MenubarSub to fix this issue.

@vercel
Copy link

vercel bot commented Jun 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
primeng-ssr-test ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2023 7:20am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
primeng ⬜️ Ignored (Inspect) Jun 28, 2023 7:20am

@vercel vercel bot temporarily deployed to Preview – primeng-ssr-test June 28, 2023 07:20 Inactive
@timurongh timurongh closed this Jul 12, 2023
@timurongh timurongh deleted the master branch July 12, 2023 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant