Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markdown-it-prism: after importing Critical dependency issues come out #313

Closed
afsarpervez opened this issue Jun 8, 2021 · 3 comments
Closed

Comments

@afsarpervez
Copy link

WARNING in ./node_modules/prismjs/components/index.js 42:23-54
Critical dependency: the request of a dependency is an expression

My code part that causing the problem while using with WebPack
import prism from 'markdown-it-prism';

farther code lines:

const md = new MarkdownIt();
md.use(prism);

I tried changing versions for different laravel mix, vue, and markdown-it-prism packages. But nothing changed. This problem only omitted when I remove the markdown-it-prism import.

@jGleitz
Copy link
Owner

jGleitz commented Jul 3, 2021

Hi, thanks for the report (and sorry for the late response).

I think this problem is part of the fact that this plugin does not work very well with Webpack (#28). So far, nobody has come up with a good solution for this. The main cause of the issue is that we need to load the language dynamically by including their files, an approach that (naturally) doesn’t work well with Webpack. I have given some hints in the README about how to circumvent this, but it is certainly not ideal.

Apart from the warning, does markdown-it-prism work for you if you include the languages manually, as explained in the README?

@NOPR9D
Copy link

NOPR9D commented Jan 7, 2022

download prismjs from : https://prismjs.com

and use like this :

image

work great for me
image

Good luck

@jGleitz
Copy link
Owner

jGleitz commented Jan 21, 2022

I am closing this as a duplicate of #28

@jGleitz jGleitz closed this as completed Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants