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

TypeError: t.hasOwnProperty is not a function #169

Open
YaokunLin opened this issue Jan 11, 2024 · 1 comment
Open

TypeError: t.hasOwnProperty is not a function #169

YaokunLin opened this issue Jan 11, 2024 · 1 comment

Comments

@YaokunLin
Copy link

YaokunLin commented Jan 11, 2024

Hi got

`TypeError: t.hasOwnProperty is not a function
at /home/user/Repos/next-auth-example/.next/server/app/resource-mgn-pivot/page.js:1:8273
at 3912 (/home/user/Repos/next-auth-example/.next/server/app/resource-mgn-pivot/page.js:5:13264)
at t (/home/user/Repos/next-auth-example/.next/server/webpack-runtime.js:1:128)
at 9683 (/home/user/Repos/next-auth-example/.next/server/app/resource-mgn-pivot/page.js:5:15263)
at t (/home/user/Repos/next-auth-example/.next/server/webpack-runtime.js:1:128)
at 1189 (/home/user/Repos/next-auth-example/.next/server/app/resource-mgn-pivot/page.js:1:2769)
at t (/home/user/Repos/next-auth-example/.next/server/webpack-runtime.js:1:128)
at F (/home/user/Repos/next-auth-example/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:91937)
at /home/user/Repos/next-auth-example/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:94352
at W._fromJSON (/home/user/Repos/next-auth-example/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:94790)

Error occurred prerendering page "/resource-mgn-pivot". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: t.hasOwnProperty is not a function
at /home/user/Repos/next-auth-example/.next/server/app/resource-mgn-pivot/page.js:1:8273
at 3912 (/home/user/Repos/next-auth-example/.next/server/app/resource-mgn-pivot/page.js:5:13264)
at t (/home/user/Repos/next-auth-example/.next/server/webpack-runtime.js:1:128)
at 9683 (/home/user/Repos/next-auth-example/.next/server/app/resource-mgn-pivot/page.js:5:15263)
at t (/home/user/Repos/next-auth-example/.next/server/webpack-runtime.js:1:128)
at 1189 (/home/user/Repos/next-auth-example/.next/server/app/resource-mgn-pivot/page.js:1:2769)
at t (/home/user/Repos/next-auth-example/.next/server/webpack-runtime.js:1:128)
at F (/home/user/Repos/next-auth-example/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:91937)
at /home/user/Repos/next-auth-example/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:94352
✓ Generating static pages (15/15) `

When trying to build the app under Next.js 14.0.4, not sure if you guys saw this build error before. I think this came from that the latest react-pivottable is not compatible, packages shows here

` "dependencies": {
"@radix-ui/react-avatar": "^1.0.3",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-dropdown-menu": "^2.0.5",
"@radix-ui/react-navigation-menu": "^1.1.3",
"@radix-ui/react-slot": "^1.0.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"lucide-react": "^0.274.0",
"next": "latest",
"next-auth": "beta",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-pivottable": "^0.11.0",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7"
},

"devDependencies": {
"@types/node": "^18",
"@types/react": "^18.2.23",
"@types/react-dom": "^18.2.8",
"@types/react-pivottable": "^0.11.5",
"@types/react-table": "^7.7.19",
"autoprefixer": "^10.4.15",
"postcss": "^8.4.29",
"tailwindcss": "^3.3.3",
"typescript": "^5.2.2"
}`

image

any help would be greatly appreciated. thanks

@fsmaestro
Copy link

That error occurred because the rendering of the following code used for pivot table.
import("react-plotly.js");

import dynamic from "next/dynamic";
const Plot = dynamic(() => import("react-plotly.js"), { ssr: false });

I used dynamic for import clause, and it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants