Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WAB widgets do not load on mobile devices #18

Closed
bsnider opened this issue Jun 14, 2017 · 6 comments
Closed

WAB widgets do not load on mobile devices #18

bsnider opened this issue Jun 14, 2017 · 6 comments

Comments

@bsnider
Copy link

bsnider commented Jun 14, 2017

  1. Load the demo in Chrome
  2. Open Dev Tools
  3. Click the 'Toggle device toolbar' icon and select a tablet or phone, such as the iPhone 7.
  4. Refresh
  5. The page never loads, with the following error:

init.js:28 Uncaught TypeError: this.widgetManager.loadWidget is not a function
at Object. (BaseWidgetPanel.js:76)
at Object.forEach (init.js:70)
at Object.loadAllWidgetsInOrder (BaseWidgetPanel.js:66)
at Object.startup (BaseWidgetPanel.js:55)
at Object.placeAt (init.js:361)
at Object.createWidget (_WidgetsMixin.js:190)
at Object. (_WidgetsMixin.js:171)
at init.js:63
at ia (init.js:28)
at init.js:28

I believe this is due to the panel being collapsed when the page loads, preventing the widget to properly initialize.

@tmcgee
Copy link
Member

tmcgee commented Jun 14, 2017

@bsnider Thanks for reporting this. I can confirm seeing the same thing in Chrome and using my phone. I just submitted a [PR](cmv/cmv-app#730 for CMV] that I believe would help address with this issue.

@tmcgee
Copy link
Member

tmcgee commented Jun 14, 2017

@bsnider I've tested this locally with the code in the PR and it doesn't appear to fix this issue. Something else is going on. Investigating...

@tmcgee
Copy link
Member

tmcgee commented Jun 14, 2017

This doesn't appear to be related to the pane open or closed. widgetManager is undefined because the code is failing silently on this method call to get the appConfig from WAB. This indicates 2 things: 1) more error handling is needed to report the error and 2) dive deeper into WAB to identify what it apparently does so different with mobile that is causing this call to fail.

@tmcgee
Copy link
Member

tmcgee commented Jun 14, 2017

@bsnider

The problem is lang.clone(this.appConfig) is failing in the getAppConfig method of WAB's ConfigManager but only when WAB detects it is running in mobile.

Current solution appear to be to change the references to cm.getAppConfig() on line 80 and line 86 to simply be cm.appConfig. There may be some residual effects from this but none detected so far...

@bsnider
Copy link
Author

bsnider commented Jun 19, 2017

@tmcgee Thank you very much for looking into this!

@tmcgee
Copy link
Member

tmcgee commented Jun 21, 2017

fixed in b1d25b3

@tmcgee tmcgee closed this as completed Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants