It will not harm your plant.
The parts exposed to light will die off and resprout inside the container, causing no issues at all, they will go through a process known as "air pruning" and is similar to topping.
Nothing to worry about, cannabis is a robust, almost indestructable plant, not a dainty, delicate fern that requires "princess perfect" conditions to survive.