mdbreact error when running built app


Topic: mdbreact error when running built app

christiaan-karsavior pro asked 4 years ago

Hello. We just purchased and are using mdbreact 4.8.2 Pro with create-react-app v2 and react 16. The app works fine in development with no errors and mdbootstrap react components rendering beautifully, but my production build fails (local or deployed) to render components using mdbreact, giving this error:

mdbreact.js:15922 Uncaught TypeError: Super expression must either be null or a function, not undefined
at mdbreact.js:15922
at mdbreact.js:15921
at Object.<anonymous> (mdbreact.js:15902)
at t (mdbreact.js:15846)
at mdbreact.js:15850
at mdbreact.js:15838
at Object.e.exports (mdbreact.js:15837)
at n (mdbreact.js:14)
at Object.e.exports (mdbreact.js:15812)
at n (mdbreact.js:14)

I also notice the package is marked as 'invalid' when using `npm ls mdbreact`. I have set up per the instructions using my generated gitlab key. Please let me know if you need further information. Thanks.


Anna Morawska staff answered 4 years ago

Hi christiaan-karsavior,  good news, we manage to fix this, it works now with react-scripts v 2.0.5. Please use branch #next to update your mdbreact version.  ( add #next to GitURL, remove node_modules folder and run npm install) Best, Ania    

Anna Morawska staff answered 4 years ago

Hi there, thank you for reporting this bug, we appreciate it!  I investigated it and already found a solution. It was caused by a webpack configuration.  Sorry for the inconvenience. It will be fixed in the next release which is scheduled to arrive on Monday. For now, you can use branch dev, just add #dev to your git URL as shown below and run again npm install again.
"mdbreact": "git+https://oauth2:YOUR TOKEN HERE@git.mdbootstrap.com/mdb/react/re-pro.git#dev"
Best,
Ania

Thanks for the help! Unfortunately, the problem is persisting. To test, I created a new create-react-app application (react-scripts is the current v2.0.5) and installed the #dev dependency as you mentioned. Here is the (similar) output:
Uncaught TypeError: Super expression must either be null or a function, not undefined
at mdbreact.js:15919
at mdbreact.js:15918
at Object.<anonymous> (mdbreact.js:15899)
at t (mdbreact.js:15843)
at mdbreact.js:15847
at mdbreact.js:15835
at Object.e.exports (mdbreact.js:15834)
at n (mdbreact.js:14)
at Object.e.exports (mdbreact.js:15809)
at n (mdbreact.js:14)

Anna Morawska staff commented 4 years ago

Yes, unfortunately, I've just checked it out and you are right. We are working on it right now, I will let you know when this will be fixed. Once again I apologize for the inconvenience.


Anna Morawska staff answered 4 years ago

Hi again, it's strange, but it looks like build is broken because of react-scripts v2.0.5. For now you can downgrade your version to 1.0.5. ( please install mdbreact from branch master, without #) We will try to find the cause as soon as possible. Best, Ania
Thanks for your help Ania! This definitely works when applied to my bare example app, but rolling react-scripts back to version 1 on our mainline app has proven to be difficult (build just hangs). We were aiming to have our site redesign deployed last Friday. Do you have a rough ETA of when this will be fixed (couple days, couple weeks)?

Anna Morawska staff answered 4 years ago

Have you tried to remove the entire node_modules folder? Also please remove browserlist configuration from package.json, and update your react-scripts to v. 1.1.5 and then run npm install. Please let me know if it helped. As I've mentioned, we are working on it right now, it's obviously a high priority, but I can't tell how long it will take to solve this :(
Excellent! Thanks for all the help!

Anna Morawska staff commented 4 years ago

No problem, thank you for reporting this to us!

Best,

Ania


Hi,

We are running into a similar problem, wherein components either do not work correctly or they are not rendered at all when the web-app is built using the build react-scripts script.

The issue does not appear when using the start react-scripts script.

What is the latest version of react-scripts that is supported by mdb? Your help is kindly appreciated,

-Matias


Piotr Glejzer staff commented 3 years ago

Hi,

I close this issue. I will answer the latest topic that you created.


FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Closed

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.7.1
  • Device: PC
  • Browser: Any
  • OS: macOS
  • Provided sample code: Yes
  • Provided link: No