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

[BUG] - Cannot read properties of undefined (reading 'length') #465

Closed
ksaitor opened this issue Oct 4, 2024 · 2 comments
Closed

[BUG] - Cannot read properties of undefined (reading 'length') #465

ksaitor opened this issue Oct 4, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ksaitor
Copy link

ksaitor commented Oct 4, 2024

Description

Screenshot 2024-10-04 at 09 43 50

Reproduction URL

n/a

Reproduction steps

1. Some of the prisma model pages throw this error

Next router

Page router

Next Admin version

6.1.4

Screenshots

No response

Next Admin options

initial clean setup. no custom options

Logs

⨯ TypeError: Cannot read properties of undefined (reading 'length')
    at eval (webpack-internal:///./node_modules/@premieroctet/next-admin/dist/utils/server.js:357:52)
    at Array.forEach (<anonymous>)
    at findRelationInData (webpack-internal:///./node_modules/@premieroctet/next-admin/dist/utils/server.js:346:72)
    at mapDataList (webpack-internal:///./node_modules/@premieroctet/next-admin/dist/utils/prisma.js:312:77)
    at getMappedDataList (webpack-internal:///./node_modules/@premieroctet/next-admin/dist/utils/prisma.js:368:15)
    at async getPropsFromParams (webpack-internal:///./node_modules/@premieroctet/next-admin/dist/utils/props.js:88:48)
    at async getNextAdminProps (webpack-internal:///./node_modules/@premieroctet/next-admin/dist/pageRouter.js:17:19)
    at async eval (webpack-internal:///./pages/admin/[[...nextadmin]].tsx:37:12)
    at async withSuperJSON (file:///Users/.../node_modules/next-superjson-plugin/dist/tools.js:7:24)
    at async e8 (/Users/.../node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:25:124)
    at async doRender (/Users/.../node_modules/next/dist/server/base-server.js:1407:30)
    at async cacheEntry.responseCache.get.routeKind (/Users/.../node_modules/next/dist/server/base-server.js:1581:28)
    at async DevServer.renderToResponseWithComponentsImpl (/Users/.../node_modules/next/dist/server/base-server.js:1489:28)
    at async DevServer.renderPageComponent (/Users/.../node_modules/next/dist/server/base-server.js:1913:24)
    at async DevServer.renderToResponseImpl (/Users/.../node_modules/next/dist/server/base-server.js:1951:32) {
  page: '/admin/article'
}


### Browsers

_No response_
@ksaitor ksaitor added the bug Something isn't working label Oct 4, 2024
@foyarash foyarash self-assigned this Oct 4, 2024
@foyarash
Copy link
Collaborator

foyarash commented Oct 4, 2024

Hello @ksaitor , thanks for the report. Can you please let us know if this issue is fixed with v6.1.5 ?

If not, could you please send the following:

  • impacted models
  • Prisma version

Thank you !

@ksaitor
Copy link
Author

ksaitor commented Oct 4, 2024

wow! it worked. thanks @foyarash 🚀

p.s. finally a working admin panel for prisma and next. Will be integrating it more and providing feedback 🚀

@ksaitor ksaitor closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants