laravel-debugbar icon indicating copy to clipboard operation
laravel-debugbar copied to clipboard

Unknown language: "sql"

Open ahmad96hijazi opened this issue 4 years ago • 8 comments
trafficstars

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 avatar Nov 23 '21 11:11 ahmad96hijazi

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)

ahmad96hijazi avatar Nov 23 '21 11:11 ahmad96hijazi

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.

maveric avatar Nov 27 '21 04:11 maveric

Did anyone get a solution?

euginepj avatar Mar 29 '22 07:03 euginepj

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

ThomasMrln avatar Apr 06 '22 15:04 ThomasMrln

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

VietTruongDev avatar Apr 12 '22 16:04 VietTruongDev

@VietTruongDev you save my day lol

nhantrandev-wt avatar Apr 12 '22 16:04 nhantrandev-wt

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.

etaroza avatar May 12 '22 12:05 etaroza

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.

stale[bot] avatar Jul 31 '22 05:07 stale[bot]

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 ✌🏻

muhsinzyne avatar Sep 20 '22 10:09 muhsinzyne

<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?

mi-hart avatar Aug 04 '23 09:08 mi-hart

<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

meztor avatar Oct 04 '23 22:10 meztor

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.

zenepay avatar Nov 05 '23 10:11 zenepay