Closed sorokinvj closed 4 years ago
Hi, glad you use the package. Can you provide some more info about your system and/or setup? It is really hard for me to get an idea without more info. Are you using next.js, or do you bundle it with a custom webpack configuration? Such things would be very helpful. Maybe you can provide a minimal repo or a codesandbox setup (see description in readme)? Thanks
Here is the repo – https://github.com/sorokinvj/test-react-parallax
Just build it locally
yarn build
and serve locally with
serve -s build
I'm also having the same problem here using nextjs. Works perfectly in development mode, but spitting out an error when the production build is run.
TypeError: Super expression must either be null or a function at index.js:1 at index.js:1 at Object.Otrq.e.exports (index.js:1) at n (index.js:1) at Object.Otrq.e.exports (index.js:1) at n (index.js:1) at Otrq.e.exports (index.js:1) at Object.Otrq (index.js:1) at l (webpack-08f7b238829422e3b9b2.js:1) at Module.RNiq (index.js:1)
Thanks for the repository link. I could reproduce it. I will also try it with a nextjs setup. Think it is due to an uglify/terser issue. Don‘t know which one cra and nextjs is using but I saw some issues on their repositories that look similar. I will investigate.
So I found a solution. It was a terser
plugin configuration issue. I added the keep_fnames
option to prevent function/class names getting mangled during production builds. Fix is in version 3.0.3
.
I'm happy about a note if the solution works for you guys.
Updated to 3.0.3
and it seems to be working perfectly. Thanks!
Closing the issue now. Feel free to reopen it if there is still related problems.
Thanks!!!! Works perfectly now and mobile is awesome!
@rrutsche getting the same error in v3.5.1
TypeError: Super expression must either be null or a function
Same error here with nextjs 14. I tried to downgrade to 3.0.3 with no success.
hey guys!
So, I spend a couple of days building a landing page with react-parallax, and everything went fine, but when I deployed the bundle strange Error happened:
I don't know what causes the error, but I double checked everything – and it is certainly something with react-parallax lib, and doesn't really depends on OS – same thing is happening on my prod server (Ubuntu) and local machine (Mac OS) when I serve the bundle. In development mode everything is ok.
The error happens when I use the basic example.
How to debug this further?