Closed ruslantau closed 4 years ago
ssr
should be disbled for vue-file-agent since it is a frontend component. Not only for nuxt, but for any Server Side Rendering technologies.
ssr
should be disbled for vue-file-agent since it is a frontend component. Not only for nuxt, but for any Server Side Rendering technologies.
Thanks for response, but it didn't help. I've got the same error. Can you add example of usages VueFileAgent with Nuxt to docs?
I changed
nuxt.config.js
{ src: '~/plugins/vue-file-agent', ssr: false }
and wrapped VueFileAgent component with <client-only>
tag
components/videoUploadsForm.vue
<client-only>
<VueFileAgent
ref="vueFileAgent"
v-model="fileRecords"
:theme="'list'"
:multiple="true"
:deletable="true"
:meta="true"
:accept="'video/*'"
:average-color="true"
:max-size="'1000MB'"
:max-files="5"
:resumable="true"
...
/>
</client-only>
Oops, I missed this from your comment:
Uncaught (in promise) Error: tus required. Please install tus-js-client
From the Docs:
You need to install [tus-js-client] for this to work. And you have to pass the tus
object to plugins.tus
as in the following example.
npm install tus-js-client --save
OR
yarn add tus-js-client
// import tus from 'tus-js-client'; // <== this won't work with latest tus-js-client
import * as tus from 'tus-js-client';
import { plugins } from 'vue-file-agent';
plugins.tus = tus;
NOTE the usage of: import * as tus from 'tus-js-client'
- Importing default from tus-js-client, as mentioned in the Website docs may not work with latest update.
Hi. I have problem with enabling resumable uploads via tus.io What am I doing wrong?
plugins/vue-file-agent.js
nuxt.config.js
package.json
Error