Hello,
So I have been attempting to use vue-isotope and masonry with nuxt, however it will work on the initial load but when the page is manually refreshed (not through webpack) I get 2 errors, the first is "Window is not defined" then if I refresh the page again i'll get "Error: render function or template not defined in component: anonymous".
I have already set SSR to false for vue-isotope in the nuxt.config and tried to use the "if (process.BROWSER_BUILD) require vueisotope, vue use isotop etc..." method and I still get the same errors.
I've had the "window is not defined" problem with previous plugins in the past but they were solved using the method above^ or disabling SSR.
Also i've noticed in previous projects using nuxt, when manually refreshing the page certain assets such as images/videos would not be loaded and navigation links would not work, then I have to reload the project again (though this only happened in the build version of nuxt, and may be a separate issue from this one).
Any help would be greatly appreciated, if you need me to upload any images or code snippets let me know.
Thanks
I've managed to fix this, it was my own stupid mistake causing the issue. I was still importing and declaring the isotope component inside my files which wasn't needed as the component was available to use globally!
Hello,
I have the same problem.
(function (exports, require, module, __filename, __dirname) { import {VueMasonryPlugin} from './src/VueMasonry.vue'
SyntaxError: Unexpected token import
I confirm. I also have an error
(function (exports, require, module, __filename, __dirname) { import {VueMasonryPlugin} from './src/VueMasonry.vue' SyntaxError: Unexpected token import
hah, I have the totally same problem with you, and I suddenly realize after read your issue!!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I've managed to fix this, it was my own stupid mistake causing the issue. I was still importing and declaring the isotope component inside my files which wasn't needed as the component was available to use globally!