justcaliturner / simple-code-editor

Simple code editor for Vue.js
https://simple-code-editor.vicuxd.com
153 stars 30 forks source link

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

Open rohitasare7 opened 1 year ago

rohitasare7 commented 1 year ago

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 commented 1 year ago

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

michael-mb commented 1 year ago

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 commented 1 year ago

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".

MiguelAleixo commented 9 months ago

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

Anubarak commented 8 months ago

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