Details
Assignee
Michael OffnerMichael OffnerReporter
Wil de BruinWil de BruinPriority
NewLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Wil de Bruin
Wil de BruinPriority
Labels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Created 12 September 2020 at 19:46
Updated 20 May 2022 at 10:00
GetComponentMetadata does not show error details when we try to get metadata of a component which has syntax errors. It wil fail with this error
lucee.transformer.bytecode.statement.ExpressionAsStatement cannot be cast to lucee.transformer.bytecode.statement.tag.TagComponent
Problem ONLY occurs when component definition is not on one line.
So
component {
is OK, but
component {
will fail. This is especially annoying in large projects using wirebox, since it is using getComponentMetaData all the time. It makes it almost impossible to track syntax errors.
Tools like cfformat will often break component definitions on multiple lines.
Description from LDEV-3955
This bug was discovered during this thread to find a solution to unrecognized dependent injection error in ColdBox: https://community.ortussolutions.com/t/missing-dependency-error-with-wirebox-injection/9192/29
Essentially, there was a line in a dependency component that was being injected that looked like the following:
else if()
This really triggered a invalid syntax bytecode error, but due to the error being in an injected dependency, the reported error that popped up on the screen was a “requested missing dependency” error, while the dependency actually wasn’t missing in the first place – it was just trying to inject a component with an invalild syntax bytecode error.
I believe we should make a more descriptive error message for this situation.