typewriterjs icon indicating copy to clipboard operation
typewriterjs copied to clipboard

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

Open logivity opened this issue 2 years ago • 5 comments

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(); }} />

logivity avatar Dec 22 '22 21:12 logivity

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.

abimnyud avatar Jan 07 '23 11:01 abimnyud

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.

Codered9 avatar Jun 05 '23 06:06 Codered9

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

abimnyud avatar Jun 05 '23 15:06 abimnyud

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!

kevthefoo avatar Jan 03 '24 15:01 kevthefoo

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

Poisonlocket avatar Apr 18 '24 13:04 Poisonlocket