Skip to content
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

Does not support other languages #14

Closed
xtan9 opened this issue Nov 1, 2018 · 10 comments
Closed

Does not support other languages #14

xtan9 opened this issue Nov 1, 2018 · 10 comments

Comments

@xtan9
Copy link

xtan9 commented Nov 1, 2018

I tried language="sql". It does not work

@koca
Copy link
Owner

koca commented Nov 2, 2018

did you import the lang somewhere in your project? Don't know how you use prismjs but maybe sth like that:

import "prismjs/components/prism-sql.js"

@xtan9
Copy link
Author

xtan9 commented Nov 2, 2018

https://codesandbox.io/s/61yrlnlnmn
It does not work in the demo also.

@koca
Copy link
Owner

koca commented Nov 2, 2018

It works if you import the sql lang file from prismjs.
add this line somewhere in main.js file.

import "prismjs/components/prism-sql.js"

@xtan9
Copy link
Author

xtan9 commented Nov 2, 2018

Perfect. Thanks for the help!

@xtan9 xtan9 closed this as completed Nov 2, 2018
@calebeaires
Copy link

I had the same problem. This issue help me to fix it. Woulb be great to put this tip on the readme.md page.

@NEK-RA
Copy link

NEK-RA commented May 14, 2020

Hi. One more question about this issue. I've got problem with "php" language.
Codesandbox — https://codesandbox.io/s/vue-prism-editor-php-raise-errors-2xuse
Problem: I've seen above the solution with SQL and checked it with PHP and JSON, so I included them into main.js:

import "prismjs/components/prism-php.js"
import "prismjs/components/prism-json.js"

When using language="json" everything works good. When I try to use language="php" these 7 problems are raised:

  1. Error in getter for watcher "content": "TypeError: Cannot read property 'tokenizePlaceholders' of undefined"
  2. Error in render: "TypeError: Cannot read property 'tokenizePlaceholders' of undefined"
  3. Error in getter for watcher "content": "TypeError: Cannot read property 'tokenizePlaceholders' of undefined"
  4. Error in render: "TypeError: Cannot read property 'tokenizePlaceholders' of undefined"
  5. Error in mounted hook: "TypeError: Cannot read property 'innerHTML' of undefined"
  6. Error in mounted hook: "TypeError: Cannot read property 'innerHTML' of undefined"
  7. Error in nextTick: "TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'."

I've also decided to check for prism object, so I've imported it from 'prismjs' and checked for prism.languages — php exists in this object.
Any thoughts about that?

@yangyang-zhang
Copy link

Hi. One more question about this issue. I've got problem with "php" language.
Codesandbox — https://codesandbox.io/s/vue-prism-editor-php-raise-errors-2xuse
Problem: I've seen above the solution with SQL and checked it with PHP and JSON, so I included them into main.js:

import "prismjs/components/prism-php.js"
import "prismjs/components/prism-json.js"

When using language="json" everything works good. When I try to use language="php" these 7 problems are raised:

  1. Error in getter for watcher "content": "TypeError: Cannot read property 'tokenizePlaceholders' of undefined"
  2. Error in render: "TypeError: Cannot read property 'tokenizePlaceholders' of undefined"
  3. Error in getter for watcher "content": "TypeError: Cannot read property 'tokenizePlaceholders' of undefined"
  4. Error in render: "TypeError: Cannot read property 'tokenizePlaceholders' of undefined"
  5. Error in mounted hook: "TypeError: Cannot read property 'innerHTML' of undefined"
  6. Error in mounted hook: "TypeError: Cannot read property 'innerHTML' of undefined"
  7. Error in nextTick: "TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'."

I've also decided to check for prism object, so I've imported it from 'prismjs' and checked for prism.languages — php exists in this object.
Any thoughts about that?

I have encountered the same problem. How did you solve it?

@koca
Copy link
Owner

koca commented Nov 5, 2020

Please upgrade to the new version v1.x

@rh78
Copy link

rh78 commented Mar 5, 2021

Hi I am on the newest version, and for CSS I get:

Error in nextTick: "TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'."

@valentinoli
Copy link

Hi I am on the newest version, and for CSS I get:

Error in nextTick: "TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'."

I got a similar error and this thread helped me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants