bl00mber / react-phone-input-2

:telephone_receiver: Highly customizable phone input component with auto formatting
https://bl00mber.github.io/react-phone-input-2.html
MIT License
949 stars 536 forks source link

Uncaught TypeError: Super expression must either be null or a function #126

Closed rlyle closed 4 years ago

rlyle commented 5 years ago

Seeing an error currently..

lib.js:1782 Uncaught TypeError: Super expression must either be null or a function at lib.js:1782 at lib.js:1781 at Module. (lib.js:1320) at n (lib.js:14) at e.exports (lib.js:50) at Object. (lib.js:4) at f ((index):1) at Module.798 (EnhancedTableToolbar.js:88) at f ((index):1) at Object.425 (apricityTextLogo.png:1)

sgehrman commented 5 years ago

same issue here

belonog commented 5 years ago

have same issue when I build next.js project, which depends on react 16.8.6

leMedi commented 5 years ago

same issue here. happens when i build in prod mode (NODE_ENV=production)

svn1991 commented 5 years ago

temporarily, try using 2.9.3 version of this package till a new fix is released...hope this helps..:)

mmcbruno commented 5 years ago

same issue, downgrading to 2.9.3 solved it.

LieeN commented 4 years ago

Same issue here, can recommend using 2.9.5 as 2.9.3 was kinda outdated

felipeaugusto1 commented 4 years ago

same issue here. and 2.9.3 is not working for me

mankutila commented 4 years ago

Same

hachok commented 4 years ago

as a workaround, you can add keep_fnames: true for a Terser plugin in Webpack configuration

ayushnawani commented 4 years ago

@bl00mber is it fixed? I am still getting this error in production

Thanks

LluisArevalo commented 4 years ago

@bl00mber we have updated to the latest version of the package and it's still not working, here is the stack trace of the error (in production):

Uncaught TypeError: Super expression must either be null or a function
    at eval (lib.js:1782)
    at eval (lib.js:1791)
    at Module.eval (lib.js:1888)
    at n (lib.js:14)
    at e.exports (lib.js:52)
    at Object.eval (lib.js:53)
    at n (bootstrap:19)
    at Module.eval (phone-component.js:6)
    at n (bootstrap:19)
    at Object.eval (index.esm.js:100)
rb162215 commented 4 years ago

Same issue Super expression must either be null or a function any solution. I am using 2.9.4

TedSean commented 4 years ago

Using 2.10.0, this issue is still there

anking commented 4 years ago

Same issue comes up with material-ui-phone-number that depends on this package

abhijit-padhy commented 3 years ago

I am still getting this error with latest version in production build "react-phone-input-2": "^2.14.0",. Following above comments I tried v2.9.3 which is also throwing same error for super expression.

It's terrific. I completed the whole implementation in local and when moved to prod it is throwing error. Now I am not sure why @bl00mber closed this ticket.

abhijit-padhy commented 3 years ago

Update: with v2.9.3 I'm not getting any error but I am not able to use 'react-phone-input-2/lib/style.css' and 'react-phone-input-2/lib/material.css' files used in v2.14.0. And without these css files flag icons are not seen the the PhoneInput component.

bl00mber commented 3 years ago

@abhijit-padhy after I closed it there were no reports of this bug. What is libraryTarget in your webpack config?

abhijit-padhy commented 3 years ago

@bl00mber We haven't used libraryTarget in our webpack config.

abhijit-padhy commented 3 years ago

And when tried with libraryTarget: 'commonjs2', as I saw in your PR comment it breaks my application.