May 08, 2020 11:42 AM
Hey folks, I’ve got a mystery/puzzle/bug.
I’ve recently rewritten one of our scripting blocks, and added the new version to our airtable base. It works great for me, exactly as intended, but when my teammate clicks “run” on her computer she immediately gets this:
SyntaxError: Unexpected token '.'
Function@[native code]
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:44565
s@blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:3861
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:3611
e@blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:66
l@blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:270
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:329
initializePromise@[native code]
Promise@[native code]
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:220
s@blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:3861
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:3611
e@blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:66
l@blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:270
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:329
initializePromise@[native code]
Promise@[native code]
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:220
s@blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:3861
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:3611
e@blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:66
l@blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:270
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:329
initializePromise@[native code]
Promise@[native code]
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:220
handle@blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:45544
blob:https://block---y-ir-meqis-zl-o6-a-k--8sp2agd.airtableblocks.com/d02f16dd-4665-46ed-9f49-116f98a4676d:1:47019
Some more facts:
I could share the code in the block (several hundred lines of JS) but the error message “[native code]” above is making me think the issue is somewhere outside of our code. Especially since it works just fine for me!
Has anyone experienced this before? any advice?
May 09, 2020 10:37 AM
Generally the Unexpected token
error indicates a syntax error.
Here are some things to look at:
Is your teammate running the script on the same base as you?
Does your teammate have the same permissions on the base as you?
Does your script use eval()
to evaluate code that does not exist in the script proper?
Does your script pull in data that might have an unexpected value (e.g. an unexpected return value from an API, or a weird value for a field in a record that doesn’t exist to you)?
Has your teammate tried restarting Airtable and/or her computer?
May 13, 2020 10:33 AM
Hey all, I wanted to follow up here… we never figured this one out, and ended up meeting our block-functionality needs by porting the entire scripting block over to a Custom block (props to airtable, that beta is so cool!!)
So if you’re finding this by search because you have a similar error, sorry to say I don’t have a resolution for you. For the debug steps above
Yes, screen-shared just to verify
Yes, both “creator” permissions
eval()
to evaluate code that does not exist in the script proper?Nope. We do make an API request, but only prompted by user action (not on load)
This seems most likely… haven’t ruled it out, but again, we are no longer blocked on this
Couldn’t hurt – she refreshed the page, but admittedly we did not restarting the whole computer.