Magento 2 creating an auto invoice at the time of shipment getting an error on the order view page

Magento 2 creating an auto invoice at the time of shipment getting an error on the order view page.

After successfully creating an invoice when the page redirected to order view getting an error mentioned on the image.

Email one is fine but adminhtml/session I am not getting anyone?

thanks in advance.

I am creating an invoice programmatically from the observer using

event --> "sales_order_shipment_save_after"

enter image description here



from Active questions tagged magento-enterprise - Magento Stack Exchange

Click link to view all answer https://magento.stackexchange.com/questions/330397/magento-2-creating-an-auto-invoice-at-the-time-of-shipment-getting-an-error-on-t