Unspecified script error when using anvil-reserved words

So a while ago I began having random trouble with ‘Script error.’ errors, I finally traced it to having a custom component with a property ‘name’. I feel like this could be caught by the UI and warned to the user before a test, because all I had to work with was deleting things until I traced it (seems like it conflicts with some built-in ‘name’ property I didn’t know about)

1 Like

This can be a gotcha.

It is, I believe, a skulpt issue. name is a reserved word in JavaScript and the compiler mangles these words to avoid conflicts. But there are a few bugs that result from the handling of mangling.

Anvil does try to catch this issue. For example if you try changing a component’s name to name you will get a warning.

There is currently a pending pull request in skulpt that aims to improve this issue. So this may be fixed in the not so distant future.

I think this might be related to that.

2 Likes

@stucork is being far too modest here. The pull request is from him :smiley:

(It’s a good one, and I am trying to get it reviewed into Skulpt master so we can ship it in Anvil ASAP)

1 Like