diff --git a/index.js b/index.js index 2b3277f..59d68a3 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,7 @@ const classes = ${classNames}; const css = \`${result.css}\`; ${options.inject && ` (function() { - if (!document.getElementById(digest)) { + if (typeof document !== "undefined" && !document.getElementById(digest)) { var ele = document.createElement('style'); ele.id = digest; ele.textContent = css;