Skip to content

Commit 9eefde6

Browse files
docs(troubleshooting): can't import named export #1070
1 parent 45a9c3a commit 9eefde6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/docs/troubleshooting.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,31 @@ Check the examples for the [`anchorSelect`](./examples/anchor-select) and [`rend
148148
<Tooltip id="my-tooltip" />
149149
```
150150

151+
## `Can't import the named export 'xxx' from non EcmaScript module (only default export is available)`
152+
153+
This problem can be fixed by adding a rule to your `webpack.config.js` file (or equivalent).
154+
155+
```js
156+
module.exports = {
157+
...
158+
module: {
159+
rules: [
160+
{
161+
test: /\.mjs$/,
162+
include: /node_modules/,
163+
type: 'javascript/auto',
164+
}
165+
]
166+
}
167+
}
168+
```
169+
170+
:::info
171+
172+
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.
173+
174+
:::
175+
151176
## Next.js `TypeError: f is not a function`
152177

153178
This problem seems to be caused by a bug related to the SWC bundler used by Next.js.

0 commit comments

Comments
 (0)