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.

Could not find module in path: 'react-syntax-highlighter/prism-light' (Single example)

See original GitHub issue

On https://react-select.com/home the link to the CodeSandbox example for the Single select list opens up https://codesandbox.io/s/53pf1?module=/example.js that has the following error :

DependencyNotFoundError
Could not find dependency: 'react-syntax-highlighter' relative to '/docs/styled-components.js'

I did install the react-syntax-highlighter dependency (10.3.0) as suggested but I get

ModuleNotFoundError
Could not find module in path: 'react-syntax-highlighter/prism-light' relative to '/docs/styled-components.js'

Can you fix it please ? Thanks !

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
shubhamgupta47commented, Mar 21, 2020

Just replace the initial few lines with this:

import { PrismLight as SyntaxHighlighter } from "react-syntax-highlighter";
import jsx from "react-syntax-highlighter/dist/esm/languages/prism/jsx";
import { tomorrow } from "react-syntax-highlighter/dist/esm/styles/prism";

const customTomorrow = {
  ...tomorrow,
  'code[class*="language-"]': {
    ...tomorrow['code[class*="language-"]'],
    fontFamily: null // inherit from css
  },
  'pre[class*="language-"]': {
    ...tomorrow['pre[class*="language-"]'],
    fontFamily: null // inherit from css
  }
};

SyntaxHighlighter.registerLanguage("jsx", jsx);

This would work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError Could not find module in path
Change your weak-memoize version to 0.7.5. This is a CodeSandBox bug, reverting back to a previous version of the module fixes the problem....
Read more >
Could not find module for target 'x86_64-apple-ios-simulator'
I have build a custom framework and everything was working fine until the update of XCode 11. The new XCode 11 released and...
Read more >
ModuleFinder (Java SE 9 & JDK 9 ) - Oracle Help Center
A finder of modules. A ModuleFinder is used to find modules during resolution or service binding. A ModuleFinder can only find one module...
Read more >
cmake-developer(7) — CMake 3.25.1 Documentation
When the module provides only a single library, this variable can be used to specify where to find headers for using the library...
Read more >
modulefinder — Find modules used by a script ... - Python Docs
This module provides a ModuleFinder class that can be used to determine the ... by a script. path can be a list of...
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