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

Multiple Components v19 | ReferenceError: Cannot access 'Splitter' before initialization #17759

Open
4 tasks
floreauwe opened this issue Feb 24, 2025 · 6 comments
Open
4 tasks
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@floreauwe
Copy link

Describe the bug

After upgrading primeNG from 19.0.6 to 19.0.7, I encounter this new error.

Test suite failed to run
ReferenceError: Cannot access 'Splitter' before initialization

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

Environment

"dependencies": {
"@angular/animations": "^19.1.7",
"@angular/common": "^19.1.7",
"@angular/compiler": "^19.1.7",
"@angular/core": "^19.1.7",
"@angular/forms": "^19.1.7",
"@angular/platform-browser": "^19.1.7",
"@angular/platform-browser-dynamic": "^19.1.7",
"@angular/router": "^19.1.7",
"@ngx-translate/core": "^16.0.4",
"@primeng/themes": "^19.0.7",
"primeng": "^19.0.7",
"rxjs": "~7.8.0",
"tslib": "^2.8.1",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^19.1.8",
"@angular/cli": "~19.1.8",
"@angular/compiler-cli": "^19.1.7",
"typescript": "^5.7.3"
},

Angular version

19.1.7

PrimeNG version

v19

Node version

22.12.0

Browser(s)

No response

Steps to reproduce the behavior

Upgrade from 19.0.6 to 19.0.7
Run spec file and test

Expected behavior

It should pass

@floreauwe floreauwe added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 24, 2025
@floreauwe
Copy link
Author

Similar issue with old ones like 11931, 12945

@cthuemler
Copy link

cthuemler commented Feb 25, 2025

I have the same issue with the Stepper Component using Jest, also after updating to 19.0.7:

ReferenceError: Cannot access 'Step' before initialization

@ratsey
Copy link

ratsey commented Feb 25, 2025

Adding a 'me too'.

  ● Test suite failed to run

    ReferenceError: Cannot access 'Splitter' before initialization

       5 | import { ContextMenuModule } from 'primeng/contextmenu';
       6 | import { SpeedDialModule } from 'primeng/speeddial';
    >  7 | import { SplitterModule } from 'primeng/splitter';
         | ^
       8 |
       9 | import { LayoutGuide } from '../../models/layout-guide';
      10 |

      at Object.<anonymous> (node_modules/primeng/fesm2022/primeng-splitter.mjs:138:264)

@DaSchTour
Copy link
Contributor

What the heck is happening to this library? It feels like it falls apart more and more with every version 😟

@floreauwe floreauwe changed the title Splitter | ReferenceError: Cannot access 'Splitter' before initialization Splitter v19 | ReferenceError: Cannot access 'Splitter' before initialization Feb 26, 2025
@tsteuwer-accesso
Copy link

@floreauwe , can you change this to "Multiple Components" as this also affects Stepper as well.

@tsteuwer-accesso
Copy link

I put up a PR to fix this issue. The issue is PrimeNG is referencing classes that haven't been defined and you have to use forawrdRef. I made a PR but i don't know when the PrimeNG team looks at these.

@floreauwe floreauwe changed the title Splitter v19 | ReferenceError: Cannot access 'Splitter' before initialization Multiple Components v19 | ReferenceError: Cannot access 'Splitter' before initialization Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

5 participants