Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

add ssr support #44

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

add ssr support #44

wants to merge 6 commits into from

Conversation

Sitronik
Copy link
Contributor

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

@Sitronik
Copy link
Contributor Author

Hello @biigpongsatorn @runyasak, please merge this working changes.

@runyasak
Copy link
Collaborator

Hi, @Sitronik.
Sorry for lately response.

Thank you for amazing PR. However, there have some errors on build.
Please, resolve the errors and update to this PR. 😁

@Sitronik
Copy link
Contributor Author

Hi, @Sitronik.
Sorry for lately response.

Thank you for amazing PR. However, there have some errors on build.
Please, resolve the errors and update to this PR. 😁

Hi, your are welcome
Build is works but in deploy app netlify have errors

I changed billi to rollup. You can download this code Then run and you will see everything works correctly

@Sitronik
Copy link
Contributor Author

Sitronik commented Jun 2, 2021

Hi, @runyasak

The errors were due to the uglifyjs library.
We need to come up with an alternative variant of minimizing the library

@Sitronik
Copy link
Contributor Author

Sitronik commented Jun 2, 2021

Fixed build netlify with rollup-plugin-uglify. Please @biigpongsatorn @runyasak, merge and publish 😁

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants