Unable to load codeSyntaxHighlight in Vue 2
See original GitHub issueSummary
I am unable to load the codeSyntaxHighlight plugin in a Vue 2 project.
Here is a shortened version of the code for the Vue single file component:
<template>
<div class="note-body">
<Editor
:options="options"
previewStyle="tab"
ref="bodyEditor"
height="1000px"
:initialValue="newBody"
@change="onEditorChange"
/>
</div>
</template>
<script>
import '@toast-ui/editor/dist/toastui-editor.css';
import 'prismjs/themes/prism.css';
import '@toast-ui/editor-plugin-code-syntax-highlight/dist/toastui-editor-plugin-code-syntax-highlight.css';
import {Editor} from '@toast-ui/vue-editor';
import codeSyntaxHighlight from '@toast-ui/editor-plugin-code-syntax-highlight';
export default {
name: 'NoteBody',
components: {
Editor
},
data: function() {
return {
newBody: '# Example text',
options: {
hideModeSwitch: true,
toolbarItems: [
['quote'],
['task'],
['link'],
['code', 'codeblock']
],
plugins: [codeSyntaxHighlight]
}
};
}
};
</script>
There also is some custom CSS for the component, but commenting it out doesn’t fix the issue.
Here are the relevant dependencies and versions in package.json:
"@toast-ui/editor-plugin-code-syntax-highlight": "^3.0.0",
"@toast-ui/vue-editor": "^3.1.5",
"prismjs": "^1.28.0",
"vue": "^2.6.14",
Version
3.1.5
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Syntax highlighting is broken · Issue #660 · vuejs/vetur - GitHub
Problem. Syntax highlighting isn't working across the board. I had this extension installed through Sarah Drasner's Vue VS Code Extension Pack, ...
Read more >why vs code syntax highlighting stop working - Stack Overflow
i use vue and vuex. i just realised that the syntax highlighting stops in the middle of the .js file. what could be...
Read more >Using Syntax Highlighting in this forum - Get Help
Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this...
Read more >Install Vue Syntax Highlighting via Package Control ... - Medium
Install Vue Syntax Highlighting package Press Command-Shift-P (Mac OS X) or Ctrl-Shift-P (Windows) to open the Command Palette. Select Package Control: Install ......
Read more >How to use highlight.js
To skip highlighting of a code block completely, use the nohighlight class: ... load the library and ALL languages hljs = require('highlight.js'); html ......
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 Free
Top 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

Sounds good. Thank you very much for the help! I think this issue can be closed then.
@nik312123
Oh, I’m so sorry. There were lots of tasks to handle on me. I just made the environment by referring to your issue. But, there is no problem. Could you check this link?