question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[4.1][Bug] Google address field generates error randomly and breaks all radio fields (leaves them blank, not selected)

See original GitHub issue

Bug report

What I did

Have few radio fields and one google address field. Do a refresh of some page which is editing one row of a model. Every 3-5th refresh causes google object to be null. Example of page: https://webapp.com/admin/company/11/edit

What I expected to happen

I expected radio buttons to load values which are set in the database.

What happened

JS throws an error saying: Uncaught ReferenceError: google is not defined Detailed: Uncaught ReferenceError: google is not defined at bpFieldInitAddressGoogleElement (edit:1548) at HTMLInputElement.<anonymous> (edit:1627) at Function.each (bundle.js?v=4.1.20@132be56989a23fd16e0957ed40775c4fba0dfef3:2) at x.fn.init.each (bundle.js?v=4.1.20@132be56989a23fd16e0957ed40775c4fba0dfef3:2) at initializeFieldsWithJavascript (edit:1622) at HTMLDocument.<anonymous> (edit:1638) at c (bundle.js?v=4.1.20@132be56989a23fd16e0957ed40775c4fba0dfef3:2) at u (bundle.js?v=4.1.20@132be56989a23fd16e0957ed40775c4fba0dfef3:2)

Screenshot 2020-08-29 at 19 32 32

What I’ve already tried to fix it

I tried looking into JS files, but didn’t find what could be the issue.

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

PHP VERSION:

PHP 7.4.9 (cli) (built: Aug 7 2020 19:23:06) ( NTS ) Copyright © The PHP Group Zend Engine v3.4.0, Copyright © Zend Technologies with Zend OPcache v7.4.9, Copyright ©, by Zend Technologies

LARAVEL VERSION:

v7.25.0@fdf3d4a40447eb286ba3820768306cae64bcc0b3

BACKPACK VERSION:

4.1.20@132be56989a23fd16e0957ed40775c4fba0dfef3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
pxpmcommented, Sep 3, 2020

@azaricstefan

Thank you very much for your time and patience helping debbug this error.

I’v just submitted PR: #3180 with your solution, clearly way cleaner than mine, thanks for the tip.

Going to close this, it should be merged at most next Monday.

Wish you the best, Pedro

0reactions
azaricstefancommented, Sep 2, 2020

Hi @pxpm,

I also prefer option 2, with this check it doesn’t fail now! if(typeof google !== "undefined") { //this is the new added line

I tested with async and I can’t reproduce it again. Thank you for detailed explanation and for the support, I appreciate it! 🍾

Can you add the check for undefined in the next update of backpack/crud?

I would also prefer to flip the condition to avoid indenting the code + it’s cleaner. 😄 Like this: if(typeof google === "undefined") { return; } Issue is solved, we can close it now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug listing with status RESOLVED with resolution OBSOLETE ...
(was: =dev-java/jdbm-1.0 is available)" status:RESOLVED resolution:OBSOLETE severity:enhancement · Bug:107027 - "dev-vcs/cvsd init script for is not ...
Read more >
Supplemental Document: BIG-IP 14.1.4 Fixes and Known Issues
Conditions: A snat-translation address is configured with ARP enabled. Impact: Application traffic should not be impacted, as external hosts ...
Read more >
Quod Libet - Read the Docs
Quod Libet is a GTK+-based audio player written in Python, using the Mutagen tagging library. It's designed.
Read more >
(PDF) The Vital Bug Location Methodology i - ResearchGate
In this document we discuss the methodology for locating bugs within the VITAL workbench. Authors: John Domingue, Marc Eisenstadt, ...
Read more >
MySQL Enterprise Monitor 2.0 - Oracle Help Center
It is not developed or intended for use in any inherently ... MySQL Enterprise Monitor: Installing Agent on Windows: Language Selection .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found