Skip to main content
Known Participant
March 24, 2023
Answered

Expression is throwing an error at line 1, except there is no error at line 1.

  • March 24, 2023
  • 1 reply
  • 2160 views

There's an error *somewhere*, but AE is throwing the error at line 1, which makes it very hard to troubleshoot. 

 

I could post the full code here, but at this point I'm more interested in knowing the how and why behind AE throwing an error at line 1. I've seen this happen before when there's an error elsewhere. It fixes when you find the error, wherever it may be. 

 

for reference, the first line is: 

 

emojiName = thisLayer.name;

 

As in, the name of the layer. 

 

There is no error here. Using the debugging function "throw emojiName" on line 2 confirms it, as the correct variable is passed. 

 

AE throws the error "array piece can't expand to more than one value"

 

This is an expression for the position attribute. The code ends with the following array:

[printX, printY]

Any ideas? Why does this happen?

 

This topic has been closed for replies.
Correct answer Dan Ebberts

This will give you an error like that:

 

a = 100;
b = 100;
printX = [a,b];
printY = 100;
[printX,printY]

 

and yes, it should probably point to line 5 being the problem instead of line 1. It's as if line 1 is the default if it's not sure where the error is. It does seem that genrally (but not always), the legacy ExtendScript engine does a better job than the JavaScript engine in giving you the info you need to zero in on an error. Sometimes I'll switch temporarily, just to see if the old engine will give me a better clue.

1 reply

Mylenium
Legend
March 24, 2023

Without seeing your full code indeed nobody can answer that for certain. That's probably a type conversion error where some variable is treated as a string.

 

Mylenium 

Known Participant
March 24, 2023

Why wouldn't it throw an error on the actual line causing the error? 

 

I'm just meta-troubleshooting now, trying to better understand why AE is functioning like this.

 

If I can't figure it out, I'll share the full code to get fresh eyes. Thanks for your reply. 

 

 

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
March 24, 2023

This will give you an error like that:

 

a = 100;
b = 100;
printX = [a,b];
printY = 100;
[printX,printY]

 

and yes, it should probably point to line 5 being the problem instead of line 1. It's as if line 1 is the default if it's not sure where the error is. It does seem that genrally (but not always), the legacy ExtendScript engine does a better job than the JavaScript engine in giving you the info you need to zero in on an error. Sometimes I'll switch temporarily, just to see if the old engine will give me a better clue.