Operator from external script doesn't load input attributes

Hey guys,
I’m trying to populate my panel with buttons that each run a different external script. I have it working for the most part, but one of the scripts, I’d like to launch a pop up dialog. I can actually get it to do it, but it won’t automatically load the appropriate input fields when I define the operator in the external script. It’ll just pop up with an empty dialog box.
However, if I define the operator within the main script, using the exact same code otherwise, it works fine. Unfortunately, having python load the input fields automatically is the only way I know to retrieve the input from the user once they’re done (self.text in the execute member function)

Is there some reason auto-populating input fields doesn’t work when defining the operator in an external script? If I can’t use the auto-populate feature, how else can I retrieve the user’s input once they’ve pressed ok?

class WM_PT_myOp(bpy.types.Operator):
bl_idname = ‘wm.myOp’
text: bpy.props.StringProperty(name= “Enter Name”, default= “”)

def execute(self, context):
    print(self.text)
    return {'FINISHED'}

def invoke(self, context, event):
    return context.window_manager.invoke_props_dialog(self)