New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in nextTick: "ReferenceError: getComputedStyle is not defined" #32
Comments
Hi @4ndre4s how did you fix this issue? I got the same error with Nuxt! |
Hi, I also used nuxt. Actually I could not fix it :( |
@4ndre4s I found the root of the problem, you need to wrap the editor around <client-only placeholder="Loading...">
<prism-editor :code="code" language="js" :line-numbers="true" />
</client-only> The error disappears from console log but the graphical issue remains. Maybe something related to the default css of Nuxt, I'll investigate further :) Thanks for the quick reply! |
Ok @4ndre4s I just fixed the second problem. We need to import import 'prismjs'
import 'prismjs/themes/prism-tomorrow.css'
import 'vue-prism-editor/dist/VuePrismEditor.css'
import PrismEditor from 'vue-prism-editor' It works great! |
Looks like there's also a PR open to fix this problem in documentation :) #36 |
Thank you! |
YW |
Oh i should also add a note for nuxt. Thanks guys! |
I have the same problem. However, the vue-prism-editor package only contains "prismeditor.min.css" and no "VuePrismEditor.css"... I am using version 1.3.0.
Edit: It looks like it only happens for php in |
@jordib123 take a look here #131, especially if you are using dynamic import. |
@Fennec-hub It looked like using php with Prism required an extra import besides prism-php
|
@4ndre4s did you manage to solve the problem ? |
I use the component in a Nuxt.js Application, but I get an error.
This is how the it gets rendered:
Error:
Code:
The text was updated successfully, but these errors were encountered: