Skip to content

Commit 6d01157

Browse files
docs: update troubleshooting on "can't import named export"
1 parent 59bb0e5 commit 6d01157

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

docs/docs/troubleshooting.mdx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,15 @@ See [issue #1029](https://github.com/ReactTooltip/react-tooltip/issues/1029) and
156156

157157
## `Can't import the named export 'xxx' from non EcmaScript module (only default export is available)`
158158

159-
This problem can be fixed by adding a rule to your `webpack.config.js` file (or equivalent).
159+
:::info
160+
161+
If you're running into this message on a project not using `webpack` or `react-scripts`, please [submit a bug report](https://github.com/ReactTooltip/react-tooltip/issues/new/choose) with information about your setup.
162+
163+
:::
164+
165+
### If you're using `webpack`
166+
167+
This problem can be fixed by adding a rule to your `webpack.config.js` file.
160168

161169
```js
162170
module.exports = {
@@ -173,11 +181,19 @@ module.exports = {
173181
}
174182
```
175183

176-
:::info
184+
### If you're using `react-scripts`
177185

178-
If you're running into this on a project not using webpack, please [submit a bug report](https://github.com/ReactTooltip/react-tooltip/issues/new/choose) with information about your setup.
186+
Try upgrading to the latest `react-scripts` version (v5.0.1 at the time of writing).
179187

180-
:::
188+
```sh
189+
npm i react-scripts@latest
190+
```
191+
192+
or
193+
194+
```sh
195+
yarn add react-scripts@latest
196+
```
181197

182198
## The tooltip component is `undefined` ([#1067](https://github.com/ReactTooltip/react-tooltip/issues/1067))
183199

0 commit comments

Comments
 (0)