Skip to content

Commit 4342e3c

Browse files
committed
docs: add troubleshooting doc
1 parent a3355de commit 4342e3c

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

docs/troubleshotting.stories.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Source, Meta } from '@storybook/addon-docs'
2+
3+
<Meta title="Documentation/Troubleshooting" />
4+
5+
# Troubleshooting
6+
7+
Welcome to our Troubleshooting Documentation! Here, you'll find solutions to common issues encountered while using Rustic UI Components. This guide offers clear instructions to help you address errors, configuration problems, and compatibility issues swiftly. Our goal is to ensure a smooth experience with our components. If you encounter challenges beyond this guide, reach out to our support team for assistance. Let's troubleshoot together!
8+
9+
**Q: Using the `CodeSnippet` component in my project gives me the error below. What should I do?**
10+
11+
```
12+
Uncaught (in promise) Error: Unrecognized extension value in extension set ([object Object]).
13+
This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.
14+
```
15+
16+
A: If you are using webpack, follow these steps to resolve it:
17+
18+
1. Update `webpack.config.js` with the code below
19+
20+
```
21+
resolve: {
22+
alias: {
23+
'@codemirror': path.resolve(__dirname, 'node_modules/@codemirror/'),
24+
}
25+
},
26+
```
27+
28+
Make sure to add `const path = require('path')` at the top of the file if it's not already there.
29+
30+
2. You might need to remove the node_modules directory and package-lock.json file from your project directory and reinstall the dependencies.

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/codeSnippet/codeSnippet.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export default {
1212
description: {
1313
component: `The CodeSnippet component, powered by [CodeMirror](https://codemirror.net/), enables the display of code blocks with syntax highlighting for various programming languages.
1414
For further customization of the component's theme, refer to the [styling guide](https://codemirror.net/examples/styling/) provided by the CodeMirror library.
15-
\nNote: CodeMirror libraries are not bundled, so they must be included in the application's build process.`,
15+
\nNote: CodeMirror libraries are not bundled, so they must be included in the application's build process. \n\n Please install the following codemirror dependencies if you want to use CodeSnippet component in your project:
16+
\n<pre><code>npm i @codemirror/language @codemirror/language-data @codemirror/state @codemirror/theme-one-dark @codemirror/view </code></pre>`,
1617
},
1718
},
1819
},

0 commit comments

Comments
 (0)