Using filepond in nuxt ssr fails
See original GitHub issueAm trying to use filepond with nuxt but am stuck on an error vueFilePond is not defined
<script>
import * as FilePond from 'filepond'
if(process.browser){
const vueFilePond = require('filepond');
require('filepond/dist/filepond.min.css');
require('filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css');
const FilePondPluginFileValidateType = require('filepond-plugin-file-validate-type');
const FilePondPluginImagePreview = require('filepond-plugin-image-preview');
const FilePond = vueFilePond(FilePondPluginFileValidateType, FilePondPluginImagePreview);
}
export default{
layout: 'backend/websitesettingslayout',
middleware: ['authenticated'],
data: () => ({
details_form: {
company_name: '',
logo:''
},
myFiles: ['cat.jpeg']
}),
mounted(){
console.log("middleware is ", this.middleware);
},
methods: {
handleFilePondInit() {
console.log('FilePond has initialized');
// FilePond instance methods are available on `this.$refs.pond`
}
},
components:{
FilePond: vueFilePond.default(FilePondPluginImagePreview)
}
}
</script>
The above throws an error vueFilePond is not defined
I have also tried importing it the normal way like
import * as FilePond from 'filepond'
components:{
FilePond
}
but it give me an error of window is not defined which points to the filepond node_modules folder
How do i make this to work with nuxtjs ssr
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
TypeError: this.$el.querySelector is not a function nuxt filepond
Go to vue-filepond GitHub repo, download the file stored in lib/index.js . Put it somewhere in your codebase and edit the mounted function,...
Read more >vue + nuxt: dynamic import of route pages fails at render-Vue.js
Coding example for the question vue + nuxt: dynamic import of route pages fails at render-Vue.js.
Read more >Nuxt SSR fetchData and asyncData - Laracasts
I faced with problem: I have two servers - test server that is hosting on 192.168.103.23 and production server that is hosting on...
Read more >Changelog - Pintura Image Editor - PQINA
Fix issue with isSafari function throwing error on SSR environment. ... Improve performance of FilePond Image Editor plugin, image posters are now generated ......
Read more >A handy FilePond adapter component for Vue - Morioh
Vue FilePond is a handy adapter component for FilePond, a JavaScript ... When using FilePond with an SSR configuration like Nuxt.js it's best...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please share the complete Nuxt.js set up.
I figured my mistake i added this as a plugin and now it works