TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
7.98k stars 1.18k forks source link

RSOD - problem with prerelease - preview #3547

Closed pmario closed 5 years ago

pmario commented 5 years ago

to reproduce:

This problem doesn't show in 5.1.17

BurningTreeC commented 5 years ago

@pmario I can reproduce this, though I don't know the root of the problem

I was able to "fix" the error in utils/fakedom.js :

TW_Element.prototype.appendChild = function(node) {
    this.children.push(node);
    try {
        node.parentNode = this;
    }
    catch(e) {}
};

... don't know how expensive this is

BurningTreeC commented 5 years ago

This problem doesn't show in 5.1.17

No, it shows in 5.1.17, too. Try the combination of CodeMirror + tools for exploring tiddlywiki internals The CodeMirror engine.js causes the error when trying to append cmDomNode through self.domNode.appendChild(cmDomNode); (around line 112 in engine.js)

BurningTreeC commented 5 years ago

I found another way to solve this...

line 110 in codemirror's engine.js:

this.cm = window.CodeMirror(function(cmDomNode) {
        Object.defineProperty(cmDomNode,'parentNode',{writable: true});
               self.domNode.appendChild(cmDomNode);
},config);
Jermolene commented 5 years ago

See my comment over on #3554: https://github.com/Jermolene/TiddlyWiki5/pull/3554#issuecomment-439984398

BurningTreeC commented 5 years ago

thanks @Jermolene, I've changed the PR so that it detects the Tiddlywiki FakeDom