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

Gutenberg 3.9: Uncaught TypeError: Cannot read property 'uid' of undefined #10102

Closed
mhair opened this issue Sep 21, 2018 · 3 comments · Fixed by #10384
Closed

Gutenberg 3.9: Uncaught TypeError: Cannot read property 'uid' of undefined #10102

mhair opened this issue Sep 21, 2018 · 3 comments · Fixed by #10384
Labels
Needs Technical Feedback Needs testing from a developer perspective.

Comments

@mhair
Copy link

mhair commented Sep 21, 2018

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Update plugin to Gutenberg 3.9
  2. Refresh browser (Vanilla TwentySeventeen). No other plugins
  3. See Error: Uncaught TypeError: Cannot read property 'uid' of undefined, line 69 of client-assets.php
  4. Offending line: var userId = window.userSettings.uid;

Expected behavior
NOT to see that.

Desktop (please complete the following information):

  • OS: Windows 7
  • Browser Chrome
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version 69.0.3497.100 (Official Build) (64-bit)
@mhair
Copy link
Author

mhair commented Sep 21, 2018

Correction to #2 above: Vanilla TwentySeventeen with child theme from Zac Gordon's course "Theming with Gutenberg", child theme is "2.2 Enqueuing CSS & JS"

@designsimply designsimply added the Needs Testing Needs further testing to be confirmed. label Sep 21, 2018
@RolfBanziger
Copy link

I can confirm i have the same issue with Gutenberg v3.9.0. The JS error is caused by lib/client-assets.php, line 258ff.
Changing line 264 to the following seems to fix this issue without any side effects.
' var userId = "";//window.userSettings.uid;',

kopepasah added a commit that referenced this issue Oct 7, 2018
The `wp-data` inline script relies on `window.userSettings.uid`, a property set in the `utils` script.

Fixes #10102
@mtias mtias added Needs Technical Feedback Needs testing from a developer perspective. and removed Needs Testing Needs further testing to be confirmed. labels Oct 7, 2018
youknowriad pushed a commit that referenced this issue Oct 8, 2018
* Add utils to the wp-data script dependencies.

The `wp-data` inline script relies on `window.userSettings.uid`, a property set in the `utils` script.

Fixes #10102

* Remove dependency script and use get_current_user_ID().
@ryancwalsh
Copy link

I had this error just now until I upgraded my Gutenberg plugin to Version 4.2.0. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Technical Feedback Needs testing from a developer perspective.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants