question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using filepond in nuxt ssr fails

See original GitHub issue

Am 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:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

8reactions
digitalitcommented, Oct 23, 2018

Please share the complete Nuxt.js set up.

7reactions
Geowancommented, Oct 14, 2018

I figured my mistake i added this as a plugin and now it works

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found