ReferenceError: document is not defined
See original GitHub issuevue & vue-cookie-law version
2.0.x, x.y.z
Reproduction Link
Steps to reproduce
What is Expected?
What is actually happening?
nuxt
<template>
<footer>
<div class="wrapper dark-gray
no-padding">`
<cookie-law theme="dark-lime"></cookie-law>
</div>
</footer>
</template>
<script>
import CookieLaw from 'vue-cookie-law';
export default {
components: {
CookieLaw
}
}
</script>
I’v got: Nuxt.js Error:
ReferenceError: document is not defined at addStyle (/var/www/vue/node_modules/vue-cookie-law/dist/vue-cookie-law.js:579:22)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to fix ReferenceError: Document is not defined ... - Sabe.io
The most common reason for getting the reference error while on the browser is when you try to access the document object too...
Read more >ReferenceError: document is not defined (in plain JavaScript)
Explanation: The error is caused because NextJs renders the page in the server only and in the server document (document is used inside...
Read more >ReferenceError: document is not defined in JavaScript
The "ReferenceError: document is not defined" error occurs for multiple reasons: ... The document relates to the document object which represents a web...
Read more >How To Fix ReferenceError document is not defined ... - Isotropic
If you are trying to use the document object and receiving a ReferenceError: document is not defined error then there is a good...
Read more >How to solve the document is not defined error - Flavio Copes
Here's how to fix the “referenceerror: document is not defined” error that you might have in Node.js or with a tool like Next.js....
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 FreeTop 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
Top GitHub Comments
Fixed in nuxt by wrapping in
<no-ssr></no-ssr>
!Hey @Katarzina
Mh yeah I guess this is a common thing for plugins that are working only in the browser. There are some guides in the nuxt.js docs on how to disable ssr for certain plugins.
I guess that the localStorage stuff is making some trouble here.