Does copying base w/ script block break the script block in the copy?

Topic Labels: Scripting extentions
1171 5
Showing results for 
Search instead for 
Did you mean: 

I created a copy of a base with a functioning script block in it (by functioning I mean it works without throwing errors), to tinker with some updates to the script. But when I run the script in this “copy” of my base, I get an error that sounds a lot like the Script Block is either trying to access the original base ID, or else has an undefined base ID … on second look, it seems to be getting through the async queries at the beginning of the script, right?.. or else it wouldn’t even hit the output.markdown() before throwing the error… :

CleanShot 2020-03-23 at 10.00.49

Clearly, I don’t have any access to globalThis.

@Stephen_Suen, @Kasra, @Shrey_Banga - able to weigh in on this?

5 Replies 5


… I copied the code from the script block, created a fresh Scripting Block in the “copy” of my original base, and pasted the script into the fresh Scripting Block – same error when running the script. What am I missing here?

Sorry! We pushed out an update this morning which appears to have some bugs, we’re rolling it back now.

Should be fixed now, apologies for the disruption.

Wild guess - globalThis is a static variable (like a script variable) that is scoped to the original base and established when you created the script block. Then, you copied the base, and the script block magically came along in that copy process and somehow, this dependency got lost in translation.

Have you tried to create a new script block in the copied base from the exact same code to see if it runs without error?

I just created a copy of a base that contains 12 script blocks and all seem to be running fine.

UPDATE: I must have missed playing with the bad push. Glad it’s resolved.

Thanks for asking this! I was getting an error earlier today and was confused.

ReferenceError: globalThis is not defined

It’s working now.