ambassify / react-avatar

Universal avatar makes it possible to fetch/generate an avatar based on the information you have about that user.
MIT License
643 stars 117 forks source link

Nextjs 13: "Super expression must either be null or a function" #256

Open jackHedaya opened 1 year ago

jackHedaya commented 1 year ago

Hi!

Making a simple project with Nextjs 13 and adding

<Avatar name="Foo Bar" />

will throw

 TypeError: Super expression must either be null or a function
    at _inherits (webpack-internal:///(sc_server)/./node_modules/@babel/runtime/helpers/inherits.js:5:15)
    at eval (webpack-internal:///(sc_server)/./node_modules/react-avatar/lib/context.js:72:28)
    at eval (webpack-internal:///(sc_server)/./node_modules/react-avatar/lib/context.js:102:2)
    at (sc_server)/./node_modules/react-avatar/lib/context.js 
    at __webpack_require__
    at eval (webpack-internal:///(sc_server)/./node_modules/react-avatar/lib/avatar.js:30:16)
a007mr commented 1 year ago

Have same problem with React + Redux project

ba-ppp commented 1 year ago

The same, how to fix that

SaketKothari commented 1 year ago

By installing the below package it worked for me npm install core-js-pure

Mecil9 commented 1 year ago

not working for ssr add 'use client' for page to fix it! ^-^