AdobeDocs / uxp-photoshop-plugin-samples

UXP Plugin samples for Photoshop 22 and higher.
MIT License
237 stars 79 forks source link

Minified React error #73

Open Tobjoern opened 2 years ago

Tobjoern commented 2 years ago

I created a project using 'ui-react'starter', using the code:

useEffect(() => {
        const setUnconnected = () => {
            setIsConnected(false)
        }

        const setConnected = () => {
            setIsConnected(true)
        }

        window.addEventListener('online', setConnected)

        window.addEventListener('offline', setUnconnected)

        return () => {
            window.removeEventListener('online', setConnected)
            window.removeEventListener('offline', setConnected)
        }
    }, [])

I get the following error:

Uncaught Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at Z (index.js:27543:404)
    at ./node_modules/react/cjs/react.production.min.js.exports.useState (index.js:27549:277)
    at Main (index.js:37249:120)
    at renderWithHooks (index.js:15334:18)
    at mountIndeterminateComponent (index.js:18013:13)
    at beginWork (index.js:19127:16)
    at e.exports.callCallback (index.js:719:14)
    at uxp://uxp-internal/domjs_scripts.js:2:8784
    at I (uxp://uxp-internal/domjs_scripts.js:2:8676)
    at uxp://uxp-internal/domjs_scripts.js:2:8168

It is very likely that there actually is something wrong with my React code, since I'm not a React expert, but the project seems to be misconfigured in some way, as the debug log is minified.

ThisIsMrAli commented 2 years ago

@Tobjoern can you share the full code of the component?