commandbox-cfformat icon indicating copy to clipboard operation
commandbox-cfformat copied to clipboard

Error on some files lucee.runtime.exp.ExpressionException: key [TAGNAME] doesn't exist

Open andmayfi92 opened this issue 2 years ago • 2 comments

I'm not sure what I did wrong here but I have a fresh setup of cfformat and it works fine on some files but on others it returns the above error.



C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 99
97:             } else if (
98:                 (cftokens.peekElement('cftag') || cftokens.peekElement('cftag-selfclosed'))
99:                 && ['cfelse', 'cfelseif'].find(cftokens.peek(true).tagName)
100:             ) {
101:                 // dedent by one to print cfelse and cfelseif
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLAttributes.cfc: line 79
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLAttributes.cfc: line 22
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLTag.cfc: line 40
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLTagBody.cfc: line 29
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 95
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\CFTagBody.cfc: line 47
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 95
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLTagBody.cfc: line 46
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 95
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLTagBody.cfc: line 46
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 95
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLTagBody.cfc: line 46
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 95
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLTagBody.cfc: line 46
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 95
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLTagBody.cfc: line 46
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 95
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLTagBody.cfc: line 46
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 95
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\HTMLTagBody.cfc: line 46
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 95
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\cftags\CFTagBody.cfc: line 47
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 95
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFTags.cfc: line 55
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFFormat.cfc: line 198
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\models\CFFormat.cfc: line 84
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\commands\cfformat\check.cfc: line 64
called from C:\Users\andre\.CommandBox\cfml\modules\commandbox-cfformat\commands\cfformat\check.cfc: line 50
called from C:\Users\andre\.CommandBox\cfml\system\services\CommandService.cfc: line 345
called from C:\Users\andre\.CommandBox\cfml\system\services\CommandService.cfc: line 158
called from C:\Users\andre\.CommandBox\cfml\system\Shell.cfc: line 784
called from C:\Users\andre\.CommandBox\cfml\system\Bootstrap.cfm: line 119```

andmayfi92 avatar Feb 06 '24 14:02 andmayfi92

Sorry about the delayed response, it is hard to tell exactly what is going on without some sample code that produces this error. Do you have some sample code you could share that reproduces this issue?

jcberquist avatar Feb 21 '24 18:02 jcberquist