Javascript &引用;无法读取属性';几何学&x27;“未定义”的定义;使用jotform和zapier时

Javascript &引用;无法读取属性';几何学&x27;“未定义”的定义;使用jotform和zapier时,javascript,zapier,Javascript,Zapier,我在jotform中有一个表单,它通过zapier发送到[spatula.io][1],在发生此错误之前,一切都正常工作: TypeError: Cannot read property 'geometry' of undefined eval (eval at <anonymous> (/var/task/index.js:52:23), <anonymous>:47:39) process._tickDomainCallback (internal/process/n

我在jotform中有一个表单,它通过zapier发送到[spatula.io][1],在发生此错误之前,一切都正常工作:

TypeError: Cannot read property 'geometry' of undefined eval (eval at <anonymous> (/var/task/index.js:52:23), <anonymous>:47:39) process._tickDomainCallback (internal/process/next_tick.js:135:7)

当我们看不到代码时,无法帮助您。但是,代码试图访问的变量似乎没有定义。看起来您想访问
对象。几何体
,但
对象
未定义的
。请参阅:eval(eval at(/var/task/index.js:52:23),:47:39)进程。_tickDomainCallback(internal/process/next_tick.js:135:7)我正在尝试添加代码,但它不允许我添加。很抱歉,我对这一点还不熟悉,而且还在不断学习,但我非常感谢您的大力帮助!我不是说我们需要看到你收到的错误信息。我的意思是,我们需要查看您编写的导致此错误消息的代码。看看如何写一个。好的,我知道了如何在问题中添加代码。
output = [{id: 123, hello: "world"}];var key = 'AIzaSyBSgUahDolVIFG3q4ogCZMOBoyZXTW78UM ';
var address = {};

input.address.split(/[\n\r]+/).forEach(function(line) {
    var parts = line.split(': ');
    address[parts[0].toLowerCase().replace(/\s+/g, '')] = parts[1];
});

var __x = {
    streetname: 'Maple Avenue',
    housenumber: '746',
    city: 'Glenside',
    state: 'PA',
    postalcode: '19038'
};

var formattedAddress = [
    address.housenumber,
    address.streetname,
    address.city,
    address.state,
    address.postalcode
].join(' ');

fetch(
    'https://maps.googleapis.com/maps/api/geocode/json?key=' +
        key +
        '&address=' +
        encodeURIComponent(formattedAddress)
)
.then(function(res) {
    return res.json();
})
.then(function(body) {
    callback(null, {
        address: formattedAddress,
        geocodeResult: body.results[0].geometry.location
    });
})
.catch(callback);