universal-vue / uvue

Vue CLI plugin to create universal Vue applications with ease
https://universal-vue.github.io/docs/
MIT License
127 stars 13 forks source link

build --modern cause vue-simple-uploader null object #28

Closed xurwxj closed 4 years ago

xurwxj commented 5 years ago

Describe the bug A clear and concise description of what the bug is. using vue-simple-uploader to upload file in app, when build without --modern, all works well, otherwise will got following error:

Uncaught TypeError: Cannot convert undefined or null to object

To Reproduce Steps to reproduce the behavior.

  1. get the demo repo
  2. yarn install
  3. yarn run ssr:build
  4. yarn run ssr:start
  5. choose a file to upload on ui of / upload success without error!
  6. yarn run ssr:build --modern
  7. yarn run ssr:start
  8. choose a file to upload on ui of / you will get above error. Reproduction repo/demo link

Expected behavior A clear and concise description of what you expected to happen.

Additional context

Please indicate versions of:

node: v10.15.0
vue-cli: V3.3
uvue: 0.1.0-alpha.17
os: mac 10.14.3
browser: chrome 72.0.3626.119
yabab-dev commented 5 years ago

I think you need to fix some issues in your code:

First, install and setup Vue No SSR correctly yarn add vue-no-ssr and:

import NoSSR from 'vue-no-ssr';
Vue.component('no-ssr', NoSSR);

Then fix not defined reference here: https://github.com/xurwxj/uvued/blob/master/src/views/Home.vue#L62

Actually with these fixes I did not encouter your provided error...

xurwxj commented 5 years ago

@chymz I've update the repo according your suggest, but still get above error on chrome's console.

yabab-dev commented 5 years ago

Sorry dude, I did not reproduce your issue, maybe it's because I dont have your backend/API to test it correctly...

xurwxj commented 5 years ago

@chymz you can copy the demo.js to conf.js to run with my backend/api to test.