Can't resolve 'highlight.js/lib/languages/node-repl'
See original GitHub issueDescribe the bug
Can't resolve 'highlight.js/lib/languages/node-repl' in '/*/node_modules/react-syntax-highlighter/dist/esm/async-languages'
To Reproduce Have react-syntax-highlighter installed with other package that depends on a version of highlight.js that’s fixed to <10.4.0.
Expected behavior react-syntax-highlighter depends on highlight.js@^10.4.0 (instead of ^10.1.1) where node-repl was added.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Website/browser build is not intended for use with Node.js ...
Looking at highlight.pack.js - both the downloaded and the one which I built, it seems that the code is supposed to work also...
Read more >highlight.js
197 languages and 248 styles; automatic language detection; multi-language code highlighting; available for node.js; works with any markup; compatible with ...
Read more >brief-highlightjs | Yarn - Package Manager
Highlight.js now defines a limited set of highlightable classes giving a consistent result across all the styles and languages. You can read a...
Read more >Lowlight - npm.io
js' import md from 'highlight.js/lib/languages/markdown.js' lowlight.registerLanguage('markdown', md) ...
Read more >Highlight-js | Fandom Developers Wiki
dev.highlight as an argument when resolved. hljs.loadAllLanguages: Loads all language components in the library. Returns a Deferred event ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It seems I found a way to make it work:
I have removed
lowlight
andreact-syntax-highlighter
from the dependencies inpackage.json
, then executedyarn install
. It seems to have “cleaned-up” theyarn.lock
file.I have also clean the cache of yarn (
yarn cache clean lowlight
andyarn cache clean react-syntax-highlighter
). I don’t know if that was actually usefull.Then
yarn add react-syntax-highlighter
andyarn install
again. Theyarn.lock
file now have onlylowlight@1.17.0
, and my build has passed.Indeed I missed that! I assumed it was actually the case following the PR wich bump highlight.js to v10.4.1: https://github.com/react-syntax-highlighter/react-syntax-highlighter/pull/338
But actually, it just updated package-lock.json. Not package.json.