jstejada / react-typist

Typing animations with React
https://jstejada.github.io/react-typist/
Other
1.4k stars 124 forks source link

"Error: 'Super expression must either be null or a function' in Typist.js" #131

Open Chen-Steve opened 11 months ago

Chen-Steve commented 11 months ago

I encountered an error in the react-typist package while using it in my Next.js application. The error message I received is as follows: Error: Super expression must either be null or a function, not undefined

(I'm also new to react-typist sorry if this a dumb issue)

Package Version: react-typist version: 2.0.5 Node.js version: 18.18.0 React version: 18.2.0

Operating System: Windows 11 Home version 10.0.22621 Build 22621

PS C:\Users\Asus\Desktop\portfolio> npm run dev

portfolio@0.1.0 dev next dev

▲ Next.js 13.5.4

my package.json file: { "name": "portfolio", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/icons-material": "^5.14.14", "@mui/material": "^5.0.0", "@types/react-typist": "^2.0.5", "bootstrap": "^5.3.2", "next": "13.5.4", "particles.js": "^2.0.0", "prop-types": "^15.8.1", "react": "^18.2.0", "react-bootstrap": "^2.9.0", "react-dom": "^18.2.0", "react-intersection-observer": "^9.5.2", "react-typist": "^2.0.5", "rsuite": "^5.40.0" }, "devDependencies": { "@types/node": "^20", "@types/react": "^18.2.28", "@types/react-bootstrap": "^0.32.34", "@types/react-dom": "^18", "autoprefixer": "^10", "eslint": "^8", "eslint-config-next": "13.5.4", "postcss": "^8", "tailwindcss": "^3.3.3", "typescript": "^5.2.2" } }

eysenshi commented 10 months ago

try add 'use client' at the top of the file you use Typist.