I am developing a DHIS2 web app and attempted to run the PWA example from this repository (app-platform/examples/pwa-app at master · dhis2/app-platform · GitHub). However, I encountered an error in the developer console, which points to the following line in the cachable-section-state.js file of the @dhis2/app-runtime package, causing the issue.
Cannot read properties of undefined (reading 'section-id-01')
TypeError: Cannot read properties of undefined (reading 'section-id-01')
at http://localhost:3000/static/js/bundle.js:28760:119
at useGlobalState (http://localhost:3000/static/js/bundle.js:29652:93)
at useCachedSection (http://localhost:3000/static/js/bundle.js:28760:89)
at useCacheableSection (http://localhost:3000/static/js/bundle.js:28833:81)
at Controls (http://localhost:3000/static/js/app.chunk.js:658:78)
at renderWithHooks (http://localhost:3000/static/js/bundle.js:105624:22)
at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:107953:17)
at beginWork (http://localhost:3000/static/js/bundle.js:108890:20)
at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:92927:18)
at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:92971:20)
Hi @Belendia! Thanks for your interest in the PWA features
I haven’t been able to reproduce that problem myself – can you let me know what kind of context you ran into this in? Answers to these questions can help me troubleshoot:
Before starting the PWA app, did you run yarn && yarn build in the root of the app-platform repository?
What browser are you using? Is it in a private browsing environment?
What version of the app-platform repository are you using?
Other than that, let me know you if have any other questions about the PWA example app or the platform offline features!