question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Shiki] no CDN provider found

See original GitHub issue

code

import * as shiki from 'shiki';

const html = ref('');
shiki
  .getHighlighter({
    theme: props.theme,
  })
  .then((highlighter) => {
    html.value = highlighter.codeToHtml(props.content, props.lang);
  })
  .catch(console.warn);

result

[Shiki] no CDN provider found, use `setCDN()` to specify the CDN for loading the resources before calling `getHighlighter()`

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
boring-planscommented, Apr 23, 2022

Agree with @Sparkenstein. For now, as is written in this file, we can load assets by setCDN('https://unpkg.com/shiki/') manually. But it’s a little bit confusing, why not just consider node_modules/shiki as a default assets folder 👻(or maybe set a default CDN)

6reactions
Sparkensteincommented, Mar 31, 2022

+1 for this, CDN feature should be optional in my opinion. especially for desktop apps created with electron, it’s not feasible to connect CDN everytime.

for now using

setCDN("/node_modules/shiki/");

with vite worked for me, since vite serves the root directory. but this is temporary and will only work with vite-like bundlers AND in dev mode. in prod you will manually (somehow) have to copy shiki/dist to your dist.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shiki
Shiki is a beautiful Syntax Highlighter. It uses TextMate grammar to tokenize strings, and colors the tokens with VS Code themes. In short,...
Read more >
What is a Content Delivery Network (CDN)? - Akamai
Content delivery networks, or CDNs, make online experiences faster and more reliable by delivering content closer to users. Learn more.
Read more >
M109r clutch adjustment
Serial number locations. 800-969-7501 320-358-4019 customerservice@denniskirk. Suzuki M109R 2006-15 FMC109* Suzuki Boulevard C50, C90, M50 2004-08 FMC110* ...
Read more >
Which CDN should I choose for users in China? - Mlytics
Not to worry, here are the 5 best CDN for China. ... Selecting the best Content Delivery Network (CDN) for users located in...
Read more >
shiki-element - npm
A web component to render code using the Shiki library. ... There are no other projects in the npm registry using shiki-element.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found