Sample app can't open an empty notebook (without metadata info inside)
tediyuwono opened this issue · 1 comments
tediyuwono commented
If I change the content of sample test.ipynb with an emply document as following:
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 0
}
I got an exception
bundle.js:2413 Exception in signal handler: TypeError: Cannot read property 'display_name' of undefined(…)
from deserialize() in :
contents.get(NOTEBOOK, {}).then(function (data) {
jupyter_js_notebook_1.deserialize(data.content, nbModel);
I managed to avoid the exception by adding following code before deserialize call:
if (!data.content.metadata.kernelspec) {
data.content.metadata.kernelspec = { "display_name": "", "language": "", "name": ""};
}
but after saving the notebook, the kernel spec information is never updated.
blink1073 commented
Thanks for the report, @tediyuwono! Fix is in #102.