-
Notifications
You must be signed in to change notification settings - Fork 164
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
Error in Next 14 with typescript #181
Comments
try to load the react-vertical-timeline-component component conditionally on the client-side. tell if it helps |
Add "use client" at the top of the component file |
`'use client' const VerticalTimeline = dynamic(() => import('react-vertical-timeline-component').then(mod => mod.VerticalTimeline), { ssr: false }); export const About = () => { return (....);}` Cara, estava com o mesmo problema que você e o código cima resolveu meu problema parcialmente. Pois, após isso, deve-se colocar o 'visible={true} em todos os VerticalTimelineElement que existe, sem isso há um problema de visualização ao dar refresh na página ou precisar fazer alguma alteração no código. Ah e eu inseri o 'react-vertical-timeline-component/style.min.css' no arquivo layout.tsx na primeira linha. |
Even after installing the @types/react-vertical-timeline-component, next keeps running into the following error:
⨯ TypeError: Cannot read properties of undefined (reading 'prototype') at __webpack_require__ (C:\Users\xxx\Documents\yyy\Personal-Projects\portfolio\.next\server\webpack-runtime.js:33:42) at __webpack_require__ (C:\Users\xxx\Documents\yyy\Personal-Projects\portfolio\.next\server\webpack-runtime.js:33:42) at __webpack_require__ (C:\Users\xxx\Documents\yyy\Personal-Projects\portfolio\.next\server\webpack-runtime.js:33:42) at eval (./src/slices/EducationandExperience/index.tsx:11:91) at (rsc)/./src/slices/EducationandExperience/index.tsx (C:\Users\xxx\Documents\yyy\Personal-Projects\portfolio\.next\server\_rsc_src_slices_EducationandExperience_index_tsx.js:68:1) at Function.__webpack_require__ (C:\Users\xxx\Documents\yyy\Personal-Projects\portfolio\.next\server\webpack-runtime.js:33:42) digest: "1293258541"
these are my dependencies:
"dependencies": { "@gsap/react": "^2.1.1", "@prismicio/client": "^7.8.0", "@prismicio/next": "^1.6.0", "@prismicio/react": "^2.8.0", "@react-three/drei": "^9.109.5", "@react-three/fiber": "^8.17.5", "@types/react-vertical-timeline-component": "^3.3.6", "clsx": "^2.1.1", "gsap": "^3.12.5", "next": "14.2.5", "react": "^18", "react-countup": "^6.5.3", "react-dom": "^18", "react-icons": "^5.2.1", "react-scroll-trigger": "^0.6.14", "react-vertical-timeline-component": "^3.6.0", "three": "^0.167.1", "ts-jest": "^29.2.3" },
The text was updated successfully, but these errors were encountered: