We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TypeError: Cannot read properties of undefined (reading 'pvtData')

It keeps throwing me an error. I want to display my data in gridcomponent.

FRONTEND:
const baseUrl = 'http://localhost:3000'; const data = new DataManager({ adaptor: new UrlAdaptor(), insertUrl: baseUrl + `/api/subject/insert/${user_id}`, updateUrl: baseUrl + `/api/subject/update/${user_id}`, deleteUrl: baseUrl + `/api/subject/delete/${user_id}`, data: baseUrl + `/api/subject`, });

API ROUTE (NEXT): // /api/orders/:id import { getSession } from 'next-auth/react'; import db from '@/utils/db'; import Subject from '@/models/Subject'; import Class from '@/models/Class'; const handler = async (req, res) => { const session = await getSession({ req }); console.log('SESSION: ', session); if (!session) { return res.status(401).send('Signin required'); } await db.connect(); const subject = await Subject.find({ teacher_id: req.query.id }); const dataID = subject.map((sub) => sub.class_id); console.log('CLASS ID: ', dataID); const classData = await Class.find({ _id: { $in: dataID } }); const mergedData = subject.map((sub) => { const classRecord = classData.find((cls) => cls._id.equals(sub.class_id)); return { ID: sub._id, Subject: sub.name, Name: classRecord.name, Year: classRecord.year, Section: classRecord.section, Semester: sub.semester, Batch: classRecord.batch, }; }); await db.disconnect(); res.json(mergedData); }; export default handler;


1 Reply

PS Pavithra Subramaniyam Syncfusion Team April 11, 2023 06:41 AM UTC

Hi Jocarl Basco,


Thanks for contacting Syncfusion support.


From your query we suspect that some duplicate package might be installed in “@syncfusion” folder of node_modules while updating. This may occur due to version mismatch of packages. So, we suggest you to delete the “@syncfusion” folder and “package.lock.json” file from your application and follow the steps provided in the below documentation for update the packages.


Documentation: https://ej2.syncfusion.com/react/documentation/common/how-to/update-npm-package


If you are still facing the issue, please share the below details which will be helpful for us to validate further.


  1. Share the full Grid code example
  2. Share the Syncfusion package version.
  3. Share an issue reproducible sample if possible.


Regards,

Pavithra S


Loader.
Live Chat Icon For mobile
Up arrow icon