This repository was archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
This repository was archived by the owner on Aug 31, 2023. It is now read-only.
SSR ReferenceError: document is not defined #46
Copy link
Copy link
Open
Description
Hi everyone I faced problem in vue ssr project
When I import vue-element-loading I get this error in ssr:
ReferenceError: document is not defined
at /Users/denis/Documents/projects/project-ssr/node_modules/vue-element-loading/node_modules/vue-runtime-helpers/inject-style/browser.js:6:14
at /Users/denis/Documents/projects/project-ssr/node_modules/vue-element-loading/lib/vue-element-loading.min.js:6:84
at Object.<anonymous> (/Users/denis/Documents/projects/project-ssr/node_modules/vue-element-loading/lib/vue-element-loading.min.js:6:160)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Module._compile (/Users/denis/Documents/projects/project-ssr/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Object.newLoader [as .js] (/Users/denis/Documents/projects/project-ssr/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at r (/Users/denis/Documents/projects/project-ssr/node_modules/vue-server-renderer/build.dev.js:9315:16)
at eval (webpack-internal:///vue-element-loading:1:18)
at Object.vue-element-loading (main.js:1566:1)
at __webpack_require__ (main.js:21:30)
at eval (webpack-internal:///../node_modules/babel-loader/lib/index.js!../node_modules/vue-loader/lib/index.js?!./vue/blog/index.vue?vue&type=script&lang=js&:14:49)
And in client:
500 | Internal Server Error
Fixed it all, please merge and publish to npm
Made the module even better I hope it will not be difficult for you to allocate a few minutes for this
Thanks
Metadata
Metadata
Assignees
Labels
No labels