uxp-photoshop-plugin-samples icon indicating copy to clipboard operation
uxp-photoshop-plugin-samples copied to clipboard

Minified React error

Open Tobjoern opened this issue 2 years ago • 1 comments

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.

Tobjoern avatar Apr 25 '22 16:04 Tobjoern

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

ThisIsMrAli avatar Jul 16 '22 08:07 ThisIsMrAli