-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Using SplitButton causes ReferenceError: Cannot access 'TieredMenu' before initialization #12945
Comments
This is a similar bug: |
I got the same errors when importing
|
Can somebody please triage this so we can at least get it on the radar? What is the triage process? Are we missing any info to get going? |
Thanks for reporting, we're investigating the issue. |
I got the same issue on 16.0.2, both Menubar and TiredMenu. From what i can tell the errors manifest themselfs different depending on the order of the import statement |
Looking closer into this issue the problem seem to be the combination of angular and primeng version. for instance latest source and angular 16.1.5 works but not angular 16.1.6. Same applies for many other version combinations. Depending on what enviornment youre using for testing a possible workaround is to use a preloader to patch any modules / barrell that causing the undesired error by removing the imports. (think extra step in workflow file) example simple sed operation would work. |
Adding that this is still an issue for me and my team, even with the latest 16.2.0 release. Are there any suggested workarounds in the interim? |
As of 16.1.0 this is also an issue with the Mega Menu. 16.0.2 works. |
Possible workaround: jest.mock('primeng/splitbutton', () => ({ |
Suggested workaround doesn't work for me. |
I added the mocks in setup-jest.ts and it works for me |
I'm using Angular 16.2 and endend up mocking this way in setup-jest.ts:
|
Describe the bug
Looks like a new bug in 15.4.0
While running tests into my application I got the following error:
Environment
Mac Jest tests.
Angular version
PrimeNG version
14.1.0
Build / Runtime
Angular CLI App
Node version (for AoT issues node --version)
v19.6.1
Browser(s)
CLI
Steps to reproduce the behavior
import {SplitButtonModule} from 'primeng/splitbutton';
npx jest --clearCache && npx jest --no-cache --updateSnapshot .
Things I've tried
Using primeng 15.3.0 and zone.js 12 works fine. With 15.4.0 and required zone.js 13 I get the new errors.
The text was updated successfully, but these errors were encountered: