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

ComponentBase: TypeError: Cannot read properties of undefined (reading 'unstyled') #5168

Closed
mondaychen opened this issue Oct 26, 2023 · 5 comments · Fixed by #5204
Closed
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@mondaychen
Copy link
Contributor

Describe the bug

I'm trying to upgrade my app to latest version of primereact (10.0.7) when I hit this error when the page loads

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'unstyled')

Call Stack
isUnstyled
../node_modules/primereact/componentbase/componentbase.esm.js (177:0)
cx
../node_modules/primereact/componentbase/componentbase.esm.js (182:0)
eval
../node_modules/primereact/ripple/ripple.esm.js (161:25)
renderWithHooks
../node_modules/react-dom/cjs/react-dom.development.js (16305:0)

I toggled on the "pause exceptions" option on Chrome DevTools and got this:
image
image

My app was a fork from https://github.com/primefaces/sakai-react

Reproducer

No response

PrimeReact version

10.0.7

React version

18.x

Language

TypeScript

Build / Runtime

Next.js

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@mondaychen mondaychen added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 26, 2023
@melloware
Copy link
Member

How long ago did you fork Sakai react?

Also is yours wrapped in PrimeReactProvider?

 <PrimeReactProvider>
                    <LayoutProvider>{children}</LayoutProvider>
</PrimeReactProvider>

@melloware melloware added Status: Needs Reproducer Issue needs a runnable reproducer and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 26, 2023
@github-actions
Copy link

Please fork the CodeSandbox project or Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days.

@mondaychen
Copy link
Contributor Author

@melloware not long ago. In fact, I can reproduce this issue with Sakai react now (master branch, latest commit primefaces/sakai-react@8aa535b).

To reproduce

  1. check out https://github.com/primefaces/sakai-react
  2. upgrade primereact in package.json "primereact": "^10.0.7"
  3. npm install
  4. npm run dev

My node version is v20.5.0

Looks like <PrimeReactProvider> is already in https://github.com/primefaces/sakai-react/blob/8aa535b4a705b1c40678c81eb28748718672841b/app/layout.tsx#L21

@melloware
Copy link
Member

Excellent I will check it out!

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Reproducer Issue needs a runnable reproducer labels Oct 26, 2023
@cagataycivici cagataycivici added this to the 10.0.8 milestone Oct 27, 2023
@melloware melloware reopened this Nov 1, 2023
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 1, 2023
@melloware melloware modified the milestones: 10.0.8, 10.0.10 Nov 1, 2023
@melloware melloware removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 1, 2023
@melloware
Copy link
Member

OK I fixed it correctly this time and tested with Sakai. It will be fixed in 10.0.10

@melloware melloware assigned melloware and unassigned habubey Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants