Error while creating new JupyterLab Notebook

At least one previous thread on here (probably worth some additional searching):

Notebook has its own create-untitled command which will do some of this for you.

Further, have a look at some of the things in notebook’s actions.tsx. These might have some higher-level patterns you can use.

Of note… adding and running code code on every notebook is pretty… invasive. you might want to consider doing it inside your notebook-creating command rather than hanging off the UI signal. As for signals, you may also want to use statusChanged instead of ready, and check for it to be idle or something.

Finally