Directional Light shadow camera - changing near and far?

I try to change Directional Light shadow camera with dat.GUI:

mydirecdir.add(mydirec.getObjectByName('li').shadow.camera, "far", 0, 300, 10).name("shadow far").onChange(function(){mydirecchange()}).listen();

getObjectByName(‘li’) is in a group and there const li = new THREE.DirectionalLight;

mydirecchange() only updates the
THREE.CameraHelper(li.shadow.camera);

For example position and target and so on are ok.
And dat.GUI shows the correct value of far but no changing with update
Is it in principle possible to change the far-value in this way?
Thank you.

I’m having similar problem using lil gui.

import GUI from "lil-gui";
import * as THREE from 'three'

gui = new GUI(); 
const directionalLight = new THREE.DirectionalLight();
gui.add(directionalLight.shadow.camera,"near").min(0).max(1).step(0.001).name("camera near")

gui shows up but the shadow camera position doesn’t change as expected.
I think there’s some more process to be done to modify the value.

missing dirLight.shadow.camera.updateProjectionMatrix()