barryvdh / laravel-debugbar

Debugbar for Laravel (Integrates PHP Debug Bar)
MIT License
17.05k stars 1.54k forks source link

Unknown language: "sql" #1260

Closed ahmad96hijazi closed 2 years ago

ahmad96hijazi commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.

Originally posted by @stale[bot] in https://github.com/barryvdh/laravel-debugbar/issues/1110#issuecomment-731711594

ahmad96hijazi commented 2 years ago

Uncaught Error: Unknown language: "sql" at Object.c [as highlight] (javascript:4) at Object.PhpDebugBar.Widgets.highlight (javascript:1278) at itemRenderer (javascript:2080) at child. (javascript:1376) at child.set (javascript:159) at child. (javascript:2238) at child.set (javascript:159) at child. (javascript:291) at child.set (javascript:159) at Array. (javascript:992)

maveric commented 2 years ago

Same here. Never had this issue until most recent install.

This issue in exclusive to me in brave browser on ubuntu 20.04. Firefox and chrome both are working fine. No longer true. Now showing up in firefox.

euginepj commented 2 years ago

Did anyone get a solution?

ThomasMrln commented 2 years ago

Same problem for me... Anyone has a solution ?

VietTruongDev commented 2 years ago

This problem took so long time but nobody have any great solution. I just faced with it and lost 5 minutes to find a solutions : you just need add this following:

<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>

after jquery and enjoy result. god bless you

nhantrandev-wt commented 2 years ago

@VietTruongDev you save my day lol

etaroza commented 2 years ago

In a theme I used it imports highlight js, but doesn't register 'sql' language

import hljs from 'highlight.js/lib/core';
import javascript from 'highlight.js/lib/languages/javascript';
import xml from 'highlight.js/lib/languages/xml';

const highlights = document.querySelectorAll('.highlight');

hljs.registerLanguage('xml', xml);
hljs.registerLanguage('javascript', javascript);
...

So I just added

hljs.registerLanguage('sql', javascript);

and the annoying error in the javascript console disappeared.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.

muhsinzyne commented 2 years ago

This problem took so long time but nobody have any great solution. I just faced with it and lost 5 minutes to find a solutions : you just need add this following:

<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>

after jquery and enjoy result. god bless you

koodos @VietTruongDev ❤️. it was spoiled almost a day😭😭

it might be the reason when we are using a custom theme and asset mixes. but still, I am wondering, why these resources are not injected from the package itself...

anyhow it should work. to everyone. who suffer like me ✌🏻

whimsy-cat commented 1 year ago
<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>

Where should I add this code?

meztor commented 11 months ago
<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>

Where should I add this code?

you add on your view.php file

zenepay commented 10 months ago

In a theme I used it imports highlight js, but doesn't register 'sql' language

import hljs from 'highlight.js/lib/core';
import javascript from 'highlight.js/lib/languages/javascript';
import xml from 'highlight.js/lib/languages/xml';

const highlights = document.querySelectorAll('.highlight');

hljs.registerLanguage('xml', xml);
hljs.registerLanguage('javascript', javascript);
...

So I just added

hljs.registerLanguage('sql', javascript);

and the annoying error in the javascript console disappeared.

Add this to resources/js/app.js then run : $ npm run build works for me well. Thank you for good share.