1

I've installed serve and have run npm run build. When I start the application everything's working except the dialogs i.e. when I open them I get a blank white screen and an error:

react-dom.production.min.js:156 Uncaught TypeError: Cannot read property 'length' of undefined
    at ri (2.3c107e85.chunk.js:2)
    at gi (2.3c107e85.chunk.js:2)
    at Object.Oi [as useEffect] (2.3c107e85.chunk.js:2)
    at Object.t.useEffect (2.3c107e85.chunk.js:2)
    at w (2.3c107e85.chunk.js:2)
    at S (2.3c107e85.chunk.js:2)
    at 2.3c107e85.chunk.js:2
    at ai (2.3c107e85.chunk.js:2)
    at Ni (2.3c107e85.chunk.js:2)
    at Vu (2.3c107e85.chunk.js:2)

If I start the application with the normal setup i.e. without serve, the dialogs start to work as expected. I'm not sure what's causing this.

DjangoDev1
  • 232
  • 4
  • 14
  • 2
    You need to show more code for us to evaluate it. Seems like its a problem in your useEffect not with material-ui. – Domino987 Apr 28 '21 at 10:28

1 Answers1

0

I'm having the same problem and I solved using the variable condition "openFlag" as a condition rendering, like this:

{ openFlag && <Dialog open={openFlag}> ... </Dialog>}