From c5dc81332a489fcf7d4958bb87deaa34b863b181 Mon Sep 17 00:00:00 2001 From: Viktor Hesselbom Date: Tue, 26 Feb 2019 14:56:36 +0100 Subject: [PATCH 1/2] Handle case where document is undefined --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index 92585bf..843f473 100644 --- a/src/index.js +++ b/src/index.js @@ -37,6 +37,10 @@ export default class Markup extends Component { trim }; + if (typeof document === 'undefined') { + return h('div', Object.assign({ dangerouslySetInnerHTML: { __html: markup } }, props), null); + } + try { vdom = markupToVdom(markup, type, h, this.map, options); } catch (error) { From 52d21361bc13e93b4d4cf77fdc8e0cf39be00b69 Mon Sep 17 00:00:00 2001 From: Viktor Hesselbom Date: Tue, 26 Feb 2019 15:04:14 +0100 Subject: [PATCH 2/2] Add prepare script to work from github --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 83ad74a..f7f1646 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "lint": "eslint {src,test}", "test:karma": "karma start --single-run", "prepublish": "npm-run-all build test", + "prepare": "npm run -s build", "release": "npm run -s build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" }, "keywords": [