Help

Error in `[native code]`?

Topic Labels: Scripting extentions
2566 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Kate_Rudolph
4 - Data Explorer
4 - Data Explorer

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:

  • it happens for her on our new code, but not our old code
  • it doesn’t happen for me on either one – they work the same
  • when I copied our new code to a separate scripting block (even on a different base), it still happened for her, but not for me
  • I’ve checked that the code inside the broken scripting block is the same for her as it is for me (no weird caching error) so the error must be somewhere in the runtime environment?

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?

2 Replies 2

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?

Kate_Rudolph
4 - Data Explorer
4 - Data Explorer

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

  • Is your teammate running the script on the same base as you?

Yes, screen-shared just to verify

  • Does your teammate have the same permissions on the base as you?

Yes, both “creator” permissions

  • Does your script use 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)

  • 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)?

This seems most likely… haven’t ruled it out, but again, we are no longer blocked on this

  • Has your teammate tried restarting Airtable and/or her computer?

Couldn’t hurt – she refreshed the page, but admittedly we did not restarting the whole computer.