[Vuejs]-How to solve "jQuery requires a window with a document" error?

4👍

As Nuxt also renders on the Server you can’t use JS that relies on window because on server render it’s not available.

Put your jQuery scripts into the mounted() hook.
Check this guide https://www.encode8.com/js/guide-to-integrate-jquery-in-nuxt to see a example.

👤Bart

Leave a comment