TypeError: Cannot read property "range" from undefined. (line 2, file "Server")

时间:2016-12-09 12:59:26

标签: javascript google-apps-script

I have a sheet with a load of peoples player IDs that then whitelists people on the server, however im having the problem of when I attempt to run the script (this has worked seemlessly for over a year on my other database (i just made a copy of that database hoping the scripts would still work but they dont)

TypeError: Cannot read property "range" from undefined. (line 2, file "Server")

On line 2 for some reason

CODE: http://pastebin.com/DMTBA1Sv

EXAMPLE DATA: I'm not very good with the technical aspect however I do project management and have worked with these scripts for a while but arent working on my copy of database.

1 个答案:

答案 0 :(得分:1)

关于你触发函数的方式很可能已经发生了变化。您正在传递参数' e'在定义函数时进入函数processServerWL,但是当函数实际运行时,没有' e' (传递的事件的简称)。

错误在于它可以读取属性范围,因为' e'没有定义。当触发器没有设置好时,这是一个非常常见的错误,所以请确保是这种情况。如果不了解有关您的使用上下文的更多信息,则无法告知为什么事件(e)参数未被传递。我敢打赌,有一个需要设置的触发器。

以下是有关此错误的更详细博客文章的链接以及解决此问题的一些方法:http://www.jeffreyeverhart.com/2016/08/06/fix-typeerror-cannot-read-property-values-undefined/