tameemsafi / typewriterjs

A simple yet powerful native javascript plugin for a cool typewriter effect.
https://www.npmjs.com/package/typewriter-effect
MIT License
2.44k stars 219 forks source link

TypeError: Super expression must either be null or a function On Nextjs 13 #164

Open logivity opened 1 year ago

logivity commented 1 year ago

Getting above error by using simple example given.

import Typewriter from "typewriter-effect";

<Typewriter onInit={(typewriter) => { typewriter .typeString("Hello World!") .callFunction(() => { console.log("String typed out!"); }) .pauseFor(2500) .deleteAll() .callFunction(() => { console.log("All strings were deleted"); }) .start(); }} />

abimnyud commented 1 year ago

Are you using the appDir beta features? I had the same issue, I wrapped the Typewriter component and added 'use client' to it, and it works for now.

Codered9 commented 1 year ago

Are you using the appDir beta features? I had the same issue, I wrapped the Typewriter component and added 'use client' to it, and it's works for now

Can you elaborate please what exactly to do. I am facing the same issue.

abimnyud commented 1 year ago

Are you using the appDir beta features? I had the same issue, I wrapped the Typewriter component and added 'use client' to it, and it's works for now

Can you elaborate please what exactly to do. I am facing the same issue.

You can see a working example here https://stackoverflow.com/questions/74614922/super-expression-must-either-be-null-or-a-function-nextjs-13

kevthefoo commented 8 months ago

Are you using the appDir beta features? I had the same issue, I wrapped the Typewriter component and added 'use client' to it, and it works for now.

Thank you! It works now!

Poisonlocket commented 5 months ago

Has anybody found a way to do this without the client directive? It forces my index page to be a client component even if i do it in a closed off component with the client directive and this breaks my application