simple-code-editor icon indicating copy to clipboard operation
simple-code-editor copied to clipboard

code inside editor is not getting highlighted despite declaring theme and language

Open rohitasare7 opened this issue 2 years ago • 5 comments

The code in my vue component --> I have declared the theme. image

output --> image

Warning in console --> image

I haven't done any changes in anything, today only I ran NPM Update, Composer Update (I have a Laravel Inertia + Vue project)

Please help if anyone facing this issue

rohitasare7 avatar Oct 13 '23 06:10 rohitasare7

So I had to revert back the highlight.js version to 11.8.0 and it is working fine now. Fortunately I had a backup and I rolled back my changes

rohitasare7 avatar Oct 13 '23 07:10 rohitasare7

So I had to revert back the highlight.js version to 11.8.0 and it is working fine now. Fortunately I had a backup and I rolled back my changes

How can you do that ?

How do you do that? I've tried to change the version in my package.json but it doesn't work. I've just noticed that the highlight.js is already in the simple-code-editor node package.

Screenshot 2023-10-25 at 21 27 45

michael-mb avatar Oct 25 '23 19:10 michael-mb

package.json

"dependencies": {
    "highlight.js": "11.8.0",
    "simple-code-editor": "^2.0.8",
    "vue": "^3.3.4",
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^4.2.3",
    "vite": "^4.3.9"
  },
  "resolutions": {
    "highlight.js": "11.8.0"
  }

I solved the problem by overwriting the dependency contained in "node_modules/highlight.js".

michael-mb avatar Oct 25 '23 20:10 michael-mb

Same problem here, I changing my dependencies on package.json to:

"highlight.js": "11.8.0", "simple-code-editor": "^2.0.8" Then just delete my yarn.lock (package.lock) and the node_modules and finally install again the dependencies with yarn or npm! Works perfectly and doesn't give any more errors in the console.

To more details see this: https://github.com/justcaliturner/simple-code-editor/pull/45

MiguelAleixo avatar Feb 02 '24 13:02 MiguelAleixo

@rohitasare7 Thank you very much - I spend 2 hours to get that working. you saved my day

Anubarak avatar Feb 23 '24 14:02 Anubarak