Skip to content

Commit e7e8e5a

Browse files
authored
[CI-4261] New Docs: Add Troubleshooting Section to Readme (#220)
* add troubleshooting section * left align text in tables * use html instead of markdown to render table * Update discussions link
1 parent 4d24cd4 commit e7e8e5a

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,63 @@ Ready-to-use, copy-paste examples with explanations.
7070
7171
🔹 For more advanced use cases check the [full documentation](https://constructor-io.github.io/constructorio-ui-autocomplete/?path=/docs/autocomplete-component-advanced-parameters--docs)
7272
73+
## 🛠 Troubleshooting
74+
75+
Common issues and solutions.
76+
77+
<table>
78+
<thead>
79+
<tr>
80+
<th>Problem</th>
81+
<th>Description</th>
82+
<th>Solution</th>
83+
</tr>
84+
</thead>
85+
<tbody>
86+
<tr>
87+
<td>Older JavaScript environments</td>
88+
<td>
89+
The library provides two different builds. CommonJS (cjs) and ECMAScript Modules (mjs)
90+
<br>
91+
<br>
92+
For ECMAScript Modules (mjs) build, the JavaScript version is ESNext which might not be supported by your environment. If that's the case and your environment is using an older Javascript version like ES6 (ES2015), you might get this error.
93+
<br>
94+
<br>
95+
<code>Module parse failed: Unexpected token (15:32) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file</code>
96+
</td>
97+
<td>
98+
To solve this you can import the CommonJS (cjs) build which supports ES6 (ES2015) syntax:
99+
<br>
100+
<br>
101+
<code>import CioAutocomplete from '@constructor-io/constructorio-ui-autocomplete/cjs'</code>
102+
</td>
103+
</tr>
104+
<tr>
105+
<td>ESLint</td>
106+
<td>
107+
There is a known issue with ESLint where it fails to resolve the paths exposed in the exports statement of NPM packages.
108+
<br>
109+
<br>
110+
For ECMAScript Modules (mjs) build. The Javascript version is ESNext which might not be supported by your environment. If that's the case and your environment is using an older Javascript version like ES6 (ES2015), you might get this error.
111+
<br>
112+
<br>
113+
<code>Unable to resolve path to module '@constructor-io/constructorio-ui-autocomplete/styles.css'</code>
114+
<br>
115+
<br>
116+
Relevant open issues:
117+
<ul>
118+
<li><a href='https://github.com/import-js/eslint-plugin-import/issues/1868'>Issue 1868</a>
119+
<li><a href='https://github.com/import-js/eslint-plugin-import/issues/1810'>Issue 1810</a>
120+
</td>
121+
<td>
122+
If you are receiving the following error, you can safely disable ESLint using <code>// eslint-disable-line</code> for that line.
123+
</td>
124+
</tr>
125+
</tbody>
126+
</table>
127+
128+
💬 Need help? Join our [GitHub Discussions](https://github.com/Constructor-io/constructorio-ui-autocomplete/discussions)
129+
73130
## 📖 API Reference
74131
75132
<!-- TODO: reference the API docs from storybook -->

0 commit comments

Comments
 (0)