Including CFCs shows message "To see details for this component ..."

While rewriting a CF9/ColdBox application into Lucee5 - I’ve encountered the following message:

“To see details for this component you need to enable debug output”

the code which is triggering this is a cfscript include of a CFC.

ie

public void function onRequest( string targetPage ) {

include "functions/functions.cfc";
include "functions/_functions_arra.cfc";

..... more code here .... 

}

When I have debugging ON - it shows me the component dump.


When I run the same code on CF9 - it produces no output (as it should) where the includes are.

Is there a better way to expose those CFC’s to the onRequest method, than with cfinclude?

I’m not sure if Lucee lets you cfinclude a CFC like Adobe does. Can you just rename those files to be a CFM? Or if you really want to, instantiate them and struct append the this scope into the local variables scope.

You mention this is a COldbox app-- what you’re doing really isn’t the “proper” way. Use the application helper file to provide UDFs that you want to be globally available. including functions from onrequest aren’t going to be available in things like handlers anyway unless this is for legacy code.

Hi @illiquent,

Lucee wants to enable debug output to view the component. If we include same component in CFM t doesn’t ask to enable the debug output but we use the include the component in requestStart(), lucee needs to enable debug output.

Include in requestStart() method is bad practice. Use brad’s comments instead of using include in onrequest start

It looked a little odd to me to include the CFCs in the onRequest.
Indeed the app I’m working on doesn’t follow best practices. I’ll look into doing it the proper coldbox as you suggest. ColdBox is the bee’s knees. Thanks for the help.

1 Like