简体   繁体   English

Google Platform.js突然抛出_.Rp未定义异常,未更改代码

[英]Google Platform.js suddenly throwing _.Rp undefined exception decipte no change in code

From 19 July 23.45 GTM +1 all our applications using platform.js (live and in testing) started throwing exceptions on loading gapi features found in platform.js. 从7月19日23:45 GTM +1开始,我们所有使用platform.js的应用程序(正在运行的和正在测试中的)开始引发加载platform.js中发现的gapi功能的异常。 No code change has been made, and the error started happening everywhere at once. 没有进行任何代码更改,并且错误立即开始在各处发生。

app.js:178 Uncaught TypeError: Cannot read property 'init' of undefined (referring to gapi.auth.init) app.js:178未捕获的TypeError:无法读取未定义的属性“ init”(请参考gapi.auth.init)

uncaught TypeError: _.Rp is not a function 未捕获的TypeError:_.Rp不是函数

Both errors originate from platform.js 这两个错误均源自platform.js

I've attempted to rebuild the fronted js project with no luck, have also tried adding <script src="https://apis.google.com/js/client.js"></script> before loading platform.js, but to no avail. 我尝试过没有运气的情况下重建前端js项目,也尝试在加载platform.js之前添加<script src="https://apis.google.com/js/client.js"></script> ,但无济于事。

It is now 1.30 AM, thanks in advance, from a very tired developer. 现在已经是一个非常疲倦的开发人员,现在是1.30 AM。

Following is a screenshot of the errors 以下是错误的屏幕截图

loadGoogleApi: function (callback, context) {
    var self = this;
    if (typeof gapi == 'undefined') {
        callback.apply(context || self);
        return;
    }
    return gapi.load('auth2', function() {
        self.auth2 = gapi.auth2.init({
            scope: 'profile email',
            client_id: Core.googleClientId
        });
        self.auth2.currentUser.listen(function (user) {
            debug.log('Google user', user);
            app.googleUser = user;
        });
        callback.apply(context || self);
    });

Actually we found the issue. 实际上,我们发现了问题。 It was a conflict we another JS script we are using. 这是我们正在使用的另一个JS脚本的冲突。 In this custom JS, we created a function called Map() and it seems that google has updated its library last night and now is also using a function called Map. 在此自定义JS中,我们创建了一个名为Map()的函数,看来Google昨晚已更新其库,现在还使用了一个名为Map的函数。 We just rename our custom JS function, and it is working. 我们只是重命名了我们的自定义JS函数,它正在工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM